@code-coaching/vuetiful 0.23.0 → 0.23.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/dist/style.css +1 -1
- package/dist/types/components/VBootstrap.vue.d.ts +1 -1
- package/dist/types/components/atoms/VAvatar.vue.d.ts +1 -1
- package/dist/types/components/atoms/VLightSwitch.vue.d.ts +2 -2
- package/dist/types/components/atoms/index.d.ts +13 -13
- package/dist/types/components/index.d.ts +2 -2
- package/dist/types/components/molecules/VAlert.vue.d.ts +1 -1
- package/dist/types/components/molecules/VCodeBlock.vue.d.ts +2 -2
- package/dist/types/components/molecules/VDrawer.vue.d.ts +1 -1
- package/dist/types/components/molecules/VListbox/VListbox.vue.d.ts +1 -1
- package/dist/types/components/molecules/VRail/VRail.vue.d.ts +1 -1
- package/dist/types/components/molecules/VRail/VRailTile.vue.d.ts +1 -1
- package/dist/types/components/molecules/index.d.ts +21 -21
- package/dist/types/directives/clipboard.d.ts +1 -1
- package/dist/types/directives/index.d.ts +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/props/props.d.ts +1 -1
- package/dist/types/services/dark-mode.service.d.ts +1 -1
- package/dist/types/services/drawer.service.d.ts +1 -1
- package/dist/types/services/index.d.ts +5 -5
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/theme/theme-switcher.vue.d.ts +23 -63
- package/dist/types/utils/theme/theme.service.d.ts +1 -1
- package/dist/vuetiful.es.mjs +82 -150
- package/dist/vuetiful.umd.js +7 -15
- package/package.json +1 -1
- package/src/assets/main.css +6 -6
- package/src/components/VBootstrap.vue +43 -43
- package/src/components/atoms/VAvatar.test.ts +71 -71
- package/src/components/atoms/VAvatar.vue +22 -23
- package/src/components/atoms/VBadge.test.ts +11 -11
- package/src/components/atoms/VBadge.vue +2 -2
- package/src/components/atoms/VButton.test.ts +82 -82
- package/src/components/atoms/VButton.vue +20 -21
- package/src/components/atoms/VChip.test.ts +11 -11
- package/src/components/atoms/VChip.vue +3 -3
- package/src/components/atoms/VLightSwitch.test.ts +6 -6
- package/src/components/atoms/VLightSwitch.vue +26 -31
- package/src/components/atoms/VRadio/VRadioDescription.test.ts +13 -13
- package/src/components/atoms/VRadio/VRadioDescription.vue +2 -2
- package/src/components/atoms/VRadio/VRadioGroup.test.ts +40 -40
- package/src/components/atoms/VRadio/VRadioGroup.vue +19 -22
- package/src/components/atoms/VRadio/VRadioItem.test.ts +67 -67
- package/src/components/atoms/VRadio/VRadioItem.vue +10 -13
- package/src/components/atoms/VRadio/VRadioLabel.test.ts +13 -13
- package/src/components/atoms/VRadio/VRadioLabel.vue +5 -3
- package/src/components/atoms/VSwitch/VSwitch.test.ts +33 -33
- package/src/components/atoms/VSwitch/VSwitch.vue +24 -27
- package/src/components/atoms/VSwitch/VSwitchDescription.test.ts +13 -13
- package/src/components/atoms/VSwitch/VSwitchDescription.vue +2 -2
- package/src/components/atoms/VSwitch/VSwitchGroup.test.ts +9 -9
- package/src/components/atoms/VSwitch/VSwitchGroup.vue +2 -2
- package/src/components/atoms/VSwitch/VSwitchLabel.test.ts +19 -19
- package/src/components/atoms/VSwitch/VSwitchLabel.vue +2 -2
- package/src/components/atoms/index.ts +13 -13
- package/src/components/index.test.ts +3 -3
- package/src/components/index.ts +2 -2
- package/src/components/molecules/VAccordion/VAccordion.test.ts +11 -17
- package/src/components/molecules/VAccordion/VAccordion.vue +3 -3
- package/src/components/molecules/VAccordion/VAccordionItem.test.ts +55 -55
- package/src/components/molecules/VAccordion/VAccordionItem.vue +9 -22
- package/src/components/molecules/VAlert.test.ts +38 -38
- package/src/components/molecules/VAlert.vue +25 -47
- package/src/components/molecules/VCard/VCard.test.ts +25 -25
- package/src/components/molecules/VCard/VCard.vue +13 -15
- package/src/components/molecules/VCard/VCardBody.test.ts +14 -14
- package/src/components/molecules/VCard/VCardBody.vue +4 -8
- package/src/components/molecules/VCard/VCardFooter.test.ts +22 -22
- package/src/components/molecules/VCard/VCardFooter.vue +10 -8
- package/src/components/molecules/VCard/VCardHeader.test.ts +25 -25
- package/src/components/molecules/VCard/VCardHeader.vue +7 -8
- package/src/components/molecules/VCodeBlock.test.ts +63 -63
- package/src/components/molecules/VCodeBlock.vue +27 -34
- package/src/components/molecules/VDrawer.test.ts +5 -5
- package/src/components/molecules/VDrawer.vue +10 -10
- package/src/components/molecules/VListbox/VListbox.test.ts +53 -53
- package/src/components/molecules/VListbox/VListbox.vue +31 -32
- package/src/components/molecules/VListbox/VListboxButton.test.ts +13 -13
- package/src/components/molecules/VListbox/VListboxButton.vue +5 -5
- package/src/components/molecules/VListbox/VListboxItem.test.ts +25 -25
- package/src/components/molecules/VListbox/VListboxItem.vue +7 -8
- package/src/components/molecules/VListbox/VListboxItems.test.ts +14 -14
- package/src/components/molecules/VListbox/VListboxItems.vue +9 -11
- package/src/components/molecules/VListbox/VListboxLabel.test.ts +10 -10
- package/src/components/molecules/VListbox/VListboxLabel.vue +2 -2
- package/src/components/molecules/VPreview.test.ts +26 -26
- package/src/components/molecules/VPreview.vue +22 -27
- package/src/components/molecules/VRail/VRail.test.ts +5 -5
- package/src/components/molecules/VRail/VRail.vue +7 -7
- package/src/components/molecules/VRail/VRailTile.test.ts +26 -28
- package/src/components/molecules/VRail/VRailTile.vue +13 -11
- package/src/components/molecules/VShell.test.ts +5 -5
- package/src/components/molecules/VShell.vue +11 -20
- package/src/components/molecules/VTabs/VTab.test.ts +48 -52
- package/src/components/molecules/VTabs/VTab.vue +13 -17
- package/src/components/molecules/VTabs/VTabPanel.test.ts +8 -8
- package/src/components/molecules/VTabs/VTabPanel.vue +1 -1
- package/src/components/molecules/VTabs/VTabs.test.ts +36 -36
- package/src/components/molecules/VTabs/VTabs.vue +18 -22
- package/src/components/molecules/index.ts +21 -21
- package/src/directives/clipboard.test.ts +9 -9
- package/src/directives/clipboard.ts +2 -2
- package/src/directives/index.ts +1 -1
- package/src/env.d.ts +2 -2
- package/src/index.test.ts +6 -6
- package/src/index.ts +7 -7
- package/src/props/index.ts +1 -1
- package/src/props/props.ts +44 -44
- package/src/services/dark-mode.service.test.ts +115 -93
- package/src/services/dark-mode.service.ts +9 -9
- package/src/services/drawer.service.test.ts +21 -21
- package/src/services/drawer.service.ts +10 -10
- package/src/services/highlight.service.test.ts +12 -12
- package/src/services/highlight.service.ts +1 -1
- package/src/services/index.ts +5 -5
- package/src/services/rail.service.test.ts +7 -7
- package/src/services/rail.service.ts +2 -2
- package/src/services/settings.service.test.ts +5 -5
- package/src/services/settings.service.ts +1 -1
- package/src/styles/all.css +7 -7
- package/src/styles/elements/buttons.css +1 -1
- package/src/styles/elements/forms.css +7 -7
- package/src/styles/elements.css +13 -13
- package/src/styles/transitions.css +2 -2
- package/src/styles/typography.css +5 -5
- package/src/themes/theme-rocket.css +10 -10
- package/src/themes/theme-sahara.css +13 -13
- package/src/themes/theme-seafoam.css +13 -13
- package/src/themes/theme-seasonal.css +4 -4
- package/src/themes/theme-skeleton.css +7 -7
- package/src/themes/theme-vintage.css +12 -12
- package/src/themes/theme-vuetiful-0.0.1.css +13 -13
- package/src/types/index.ts +46 -46
- package/src/types/tailwind.ts +2 -21
- package/src/utils/index.test.ts +3 -3
- package/src/utils/index.ts +2 -2
- package/src/utils/platform/platform.service.test.ts +6 -6
- package/src/utils/platform/platform.service.ts +1 -1
- package/src/utils/theme/callback.test.ts +6 -6
- package/src/utils/theme/remove.test.ts +8 -8
- package/src/utils/theme/theme-switcher.vue +58 -131
- package/src/utils/theme/theme.service.test.ts +69 -61
- package/src/utils/theme/theme.service.ts +19 -20
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import { mount } from
|
|
2
|
-
import { describe, expect, test } from
|
|
3
|
-
import VSwitch from
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import VSwitch from './VSwitch.vue';
|
|
4
4
|
|
|
5
|
-
describe(
|
|
6
|
-
test(
|
|
5
|
+
describe('VSwitch props', () => {
|
|
6
|
+
test('defaults', () => {
|
|
7
7
|
const wrapper = mount(VSwitch);
|
|
8
8
|
|
|
9
9
|
expect(wrapper.props()).toEqual({
|
|
10
10
|
modelValue: false,
|
|
11
11
|
disabled: false,
|
|
12
|
-
size:
|
|
13
|
-
classTrack:
|
|
14
|
-
classThumb:
|
|
15
|
-
as:
|
|
16
|
-
name:
|
|
12
|
+
size: 'md',
|
|
13
|
+
classTrack: 'variant-filled',
|
|
14
|
+
classThumb: 'bg-surface-100-800-token',
|
|
15
|
+
as: 'button',
|
|
16
|
+
name: '',
|
|
17
17
|
unstyled: false,
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
test(
|
|
21
|
+
test('size xs', () => {
|
|
22
22
|
const wrapper = mount(VSwitch, {
|
|
23
23
|
props: {
|
|
24
|
-
size:
|
|
24
|
+
size: 'xs',
|
|
25
25
|
},
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
const track = wrapper.find("[data-test='switch-track']");
|
|
29
|
-
expect(track.attributes(
|
|
29
|
+
expect(track.attributes('class')).toContain('w-8 h-4');
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
test(
|
|
32
|
+
test('size sm', () => {
|
|
33
33
|
const wrapper = mount(VSwitch, {
|
|
34
34
|
props: {
|
|
35
|
-
size:
|
|
35
|
+
size: 'sm',
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
const track = wrapper.find("[data-test='switch-track']");
|
|
40
|
-
expect(track.attributes(
|
|
40
|
+
expect(track.attributes('class')).toContain('w-12 h-6');
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
-
test(
|
|
43
|
+
test('size md', () => {
|
|
44
44
|
const wrapper = mount(VSwitch, {
|
|
45
45
|
props: {
|
|
46
|
-
size:
|
|
46
|
+
size: 'md',
|
|
47
47
|
},
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
const track = wrapper.find("[data-test='switch-track']");
|
|
51
|
-
expect(track.attributes(
|
|
51
|
+
expect(track.attributes('class')).toContain('w-16 h-8');
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
test(
|
|
54
|
+
test('size lg', () => {
|
|
55
55
|
const wrapper = mount(VSwitch, {
|
|
56
56
|
props: {
|
|
57
|
-
size:
|
|
57
|
+
size: 'lg',
|
|
58
58
|
},
|
|
59
59
|
});
|
|
60
60
|
|
|
61
61
|
const track = wrapper.find("[data-test='switch-track']");
|
|
62
|
-
expect(track.attributes(
|
|
62
|
+
expect(track.attributes('class')).toContain('w-20 h-10');
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
test(
|
|
65
|
+
test('size xl', () => {
|
|
66
66
|
const wrapper = mount(VSwitch, {
|
|
67
67
|
props: {
|
|
68
|
-
size:
|
|
68
|
+
size: 'xl',
|
|
69
69
|
},
|
|
70
70
|
});
|
|
71
71
|
|
|
72
72
|
const track = wrapper.find("[data-test='switch-track']");
|
|
73
|
-
expect(track.attributes(
|
|
73
|
+
expect(track.attributes('class')).toContain('w-24 h-12');
|
|
74
74
|
});
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
describe(
|
|
78
|
-
test(
|
|
77
|
+
describe('VSwitch events', () => {
|
|
78
|
+
test('update:modelValue', async () => {
|
|
79
79
|
const wrapper = mount(VSwitch, {
|
|
80
80
|
props: {
|
|
81
81
|
modelValue: false,
|
|
@@ -83,18 +83,18 @@ describe("VSwitch events", () => {
|
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
await wrapper.setProps({ modelValue: true });
|
|
86
|
-
expect(wrapper.emitted()).toHaveProperty(
|
|
86
|
+
expect(wrapper.emitted()).toHaveProperty('update:modelValue');
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
describe(
|
|
91
|
-
test(
|
|
90
|
+
describe('VSwitch default slot', () => {
|
|
91
|
+
test('default slot', () => {
|
|
92
92
|
const wrapper = mount(VSwitch, {
|
|
93
93
|
slots: {
|
|
94
|
-
default:
|
|
94
|
+
default: 'John Duck',
|
|
95
95
|
},
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
expect(wrapper.text()).toContain(
|
|
98
|
+
expect(wrapper.text()).toContain('John Duck');
|
|
99
99
|
});
|
|
100
|
-
})
|
|
100
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useSettings } from
|
|
3
|
-
import { sizeProp, unstyledProp } from
|
|
4
|
-
import { Switch } from
|
|
5
|
-
import { computed, ref, watch } from
|
|
2
|
+
import { useSettings } from '@/index';
|
|
3
|
+
import { sizeProp, unstyledProp } from '@/props';
|
|
4
|
+
import { Switch } from '@headlessui/vue';
|
|
5
|
+
import { computed, ref, watch } from 'vue';
|
|
6
6
|
|
|
7
|
-
const emit = defineEmits([
|
|
7
|
+
const emit = defineEmits(['update:modelValue']);
|
|
8
8
|
const props = defineProps({
|
|
9
9
|
modelValue: {
|
|
10
10
|
type: Boolean,
|
|
@@ -17,20 +17,20 @@ const props = defineProps({
|
|
|
17
17
|
|
|
18
18
|
classTrack: {
|
|
19
19
|
type: String,
|
|
20
|
-
default:
|
|
20
|
+
default: 'variant-filled',
|
|
21
21
|
},
|
|
22
22
|
classThumb: {
|
|
23
23
|
type: String,
|
|
24
|
-
default:
|
|
24
|
+
default: 'bg-surface-100-800-token',
|
|
25
25
|
},
|
|
26
26
|
|
|
27
27
|
as: {
|
|
28
28
|
type: String,
|
|
29
|
-
default:
|
|
29
|
+
default: 'button',
|
|
30
30
|
},
|
|
31
31
|
name: {
|
|
32
32
|
type: String,
|
|
33
|
-
default:
|
|
33
|
+
default: '',
|
|
34
34
|
},
|
|
35
35
|
|
|
36
36
|
size: sizeProp,
|
|
@@ -42,33 +42,32 @@ watch(
|
|
|
42
42
|
() => props.modelValue,
|
|
43
43
|
(newValue) => {
|
|
44
44
|
parentModelValue.value = newValue;
|
|
45
|
-
}
|
|
45
|
+
},
|
|
46
46
|
);
|
|
47
47
|
watch(
|
|
48
48
|
() => parentModelValue.value,
|
|
49
49
|
(newValue) => {
|
|
50
|
-
emit(
|
|
51
|
-
}
|
|
50
|
+
emit('update:modelValue', newValue);
|
|
51
|
+
},
|
|
52
52
|
);
|
|
53
53
|
|
|
54
54
|
const trackSize = computed(() => {
|
|
55
55
|
switch (props.size) {
|
|
56
|
-
case
|
|
57
|
-
return
|
|
58
|
-
case
|
|
59
|
-
return
|
|
60
|
-
case
|
|
61
|
-
return
|
|
62
|
-
case
|
|
63
|
-
return
|
|
64
|
-
case
|
|
65
|
-
return
|
|
56
|
+
case 'xs':
|
|
57
|
+
return 'w-8 h-4';
|
|
58
|
+
case 'sm':
|
|
59
|
+
return 'w-12 h-6';
|
|
60
|
+
case 'md':
|
|
61
|
+
return 'w-16 h-8';
|
|
62
|
+
case 'lg':
|
|
63
|
+
return 'w-20 h-10';
|
|
64
|
+
case 'xl':
|
|
65
|
+
return 'w-24 h-12';
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
const { settings } = useSettings();
|
|
70
|
-
const isUnstyled =
|
|
71
|
-
settings.global.unstyled || settings.components.switch.unstyled || props.unstyled;
|
|
70
|
+
const isUnstyled = settings.global.unstyled || settings.components.switch.unstyled || props.unstyled;
|
|
72
71
|
</script>
|
|
73
72
|
|
|
74
73
|
<template>
|
|
@@ -76,9 +75,7 @@ const isUnstyled =
|
|
|
76
75
|
<Switch
|
|
77
76
|
data-test="switch"
|
|
78
77
|
:class="`vuetiful-slide-toggle ${
|
|
79
|
-
isUnstyled
|
|
80
|
-
? ''
|
|
81
|
-
: `rounded-container-token ${disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'}`
|
|
78
|
+
isUnstyled ? '' : `rounded-container-token ${disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer'}`
|
|
82
79
|
}`"
|
|
83
80
|
:name="name"
|
|
84
81
|
:as="as"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { mount } from
|
|
2
|
-
import { describe, expect, test } from
|
|
3
|
-
import VSwitchDescription from
|
|
4
|
-
import VSwitchGroup from
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import VSwitchDescription from './VSwitchDescription.vue';
|
|
4
|
+
import VSwitchGroup from './VSwitchGroup.vue';
|
|
5
5
|
|
|
6
|
-
test(
|
|
6
|
+
test('VSwitchDescription using slot', () => {
|
|
7
7
|
const wrapper = mount({
|
|
8
8
|
template: `
|
|
9
9
|
<v-switch-group>
|
|
@@ -11,15 +11,15 @@ test("VSwitchDescription using slot", () => {
|
|
|
11
11
|
</v-switch-group>
|
|
12
12
|
`,
|
|
13
13
|
components: {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
'v-switch-label': VSwitchDescription,
|
|
15
|
+
'v-switch-group': VSwitchGroup,
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
expect(wrapper.text()).toContain(
|
|
19
|
+
expect(wrapper.text()).toContain('John Duck');
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
describe(
|
|
22
|
+
describe('VSwitchDescription props', () => {
|
|
23
23
|
test("default 'as' prop", () => {
|
|
24
24
|
const wrapper = mount({
|
|
25
25
|
template: `
|
|
@@ -28,8 +28,8 @@ describe("VSwitchDescription props", () => {
|
|
|
28
28
|
</v-switch-group>
|
|
29
29
|
`,
|
|
30
30
|
components: {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
'v-switch-label': VSwitchDescription,
|
|
32
|
+
'v-switch-group': VSwitchGroup,
|
|
33
33
|
},
|
|
34
34
|
});
|
|
35
35
|
|
|
@@ -44,8 +44,8 @@ describe("VSwitchDescription props", () => {
|
|
|
44
44
|
</v-switch-group>
|
|
45
45
|
`,
|
|
46
46
|
components: {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
'v-switch-label': VSwitchDescription,
|
|
48
|
+
'v-switch-group': VSwitchGroup,
|
|
49
49
|
},
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { mount } from
|
|
2
|
-
import { describe, expect, test } from
|
|
3
|
-
import VSwitchGroup from
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import VSwitchGroup from './VSwitchGroup.vue';
|
|
4
4
|
|
|
5
|
-
test(
|
|
5
|
+
test('VSwitchGroup using slot', () => {
|
|
6
6
|
const wrapper = mount(VSwitchGroup as any, {
|
|
7
7
|
slots: {
|
|
8
|
-
default:
|
|
8
|
+
default: 'John Duck',
|
|
9
9
|
},
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
expect(wrapper.text()).toContain(
|
|
12
|
+
expect(wrapper.text()).toContain('John Duck');
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
describe(
|
|
15
|
+
describe('VSwitchGroup props', () => {
|
|
16
16
|
test("custom 'as' prop", () => {
|
|
17
17
|
const wrapper = mount(VSwitchGroup as any, {
|
|
18
18
|
props: {
|
|
19
|
-
as:
|
|
19
|
+
as: 'div',
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
const divEl = wrapper.find(
|
|
23
|
+
const divEl = wrapper.find('div');
|
|
24
24
|
expect(divEl).not.toBeUndefined();
|
|
25
25
|
});
|
|
26
26
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { mount } from
|
|
2
|
-
import { describe, expect, test } from
|
|
3
|
-
import VSwitchGroup from
|
|
4
|
-
import VSwitchLabel from
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import VSwitchGroup from './VSwitchGroup.vue';
|
|
4
|
+
import VSwitchLabel from './VSwitchLabel.vue';
|
|
5
5
|
|
|
6
|
-
test(
|
|
6
|
+
test('VSwitchLabel using slot', () => {
|
|
7
7
|
const wrapper = mount({
|
|
8
8
|
template: `
|
|
9
9
|
<v-switch-group>
|
|
@@ -11,15 +11,15 @@ test("VSwitchLabel using slot", () => {
|
|
|
11
11
|
</v-switch-group>
|
|
12
12
|
`,
|
|
13
13
|
components: {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
'v-switch-label': VSwitchLabel,
|
|
15
|
+
'v-switch-group': VSwitchGroup,
|
|
16
16
|
},
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
expect(wrapper.text()).toContain(
|
|
19
|
+
expect(wrapper.text()).toContain('John Duck');
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
describe(
|
|
22
|
+
describe('VSwitchLabel props', () => {
|
|
23
23
|
test("default 'as' prop", () => {
|
|
24
24
|
const wrapper = mount({
|
|
25
25
|
template: `
|
|
@@ -28,8 +28,8 @@ describe("VSwitchLabel props", () => {
|
|
|
28
28
|
</v-switch-group>
|
|
29
29
|
`,
|
|
30
30
|
components: {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
'v-switch-label': VSwitchLabel,
|
|
32
|
+
'v-switch-group': VSwitchGroup,
|
|
33
33
|
},
|
|
34
34
|
});
|
|
35
35
|
|
|
@@ -44,8 +44,8 @@ describe("VSwitchLabel props", () => {
|
|
|
44
44
|
</v-switch-group>
|
|
45
45
|
`,
|
|
46
46
|
components: {
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
'v-switch-label': VSwitchLabel,
|
|
48
|
+
'v-switch-group': VSwitchGroup,
|
|
49
49
|
},
|
|
50
50
|
});
|
|
51
51
|
|
|
@@ -61,13 +61,13 @@ describe("VSwitchLabel props", () => {
|
|
|
61
61
|
</v-switch-group>
|
|
62
62
|
`,
|
|
63
63
|
components: {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
'v-switch-label': VSwitchLabel,
|
|
65
|
+
'v-switch-group': VSwitchGroup,
|
|
66
66
|
},
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
const label = wrapper.findComponent(VSwitchLabel);
|
|
70
|
-
expect(label.props(
|
|
70
|
+
expect(label.props('passive')).toBe(false);
|
|
71
71
|
});
|
|
72
72
|
|
|
73
73
|
test("custom 'passive' prop'", () => {
|
|
@@ -78,12 +78,12 @@ describe("VSwitchLabel props", () => {
|
|
|
78
78
|
</v-switch-group>
|
|
79
79
|
`,
|
|
80
80
|
components: {
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
'v-switch-label': VSwitchLabel,
|
|
82
|
+
'v-switch-group': VSwitchGroup,
|
|
83
83
|
},
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
const label = wrapper.findComponent(VSwitchLabel);
|
|
87
|
-
expect(label.props(
|
|
87
|
+
expect(label.props('passive')).toBe(true);
|
|
88
88
|
});
|
|
89
89
|
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import VAvatar from
|
|
2
|
-
import VBadge from
|
|
3
|
-
import VButton from
|
|
4
|
-
import VChip from
|
|
5
|
-
import VLightSwitch from
|
|
1
|
+
import VAvatar from './VAvatar.vue';
|
|
2
|
+
import VBadge from './VBadge.vue';
|
|
3
|
+
import VButton from './VButton.vue';
|
|
4
|
+
import VChip from './VChip.vue';
|
|
5
|
+
import VLightSwitch from './VLightSwitch.vue';
|
|
6
6
|
|
|
7
|
-
import VRadioDescription from
|
|
8
|
-
import VRadioGroup from
|
|
9
|
-
import VRadioItem from
|
|
10
|
-
import VRadioLabel from
|
|
7
|
+
import VRadioDescription from './VRadio/VRadioDescription.vue';
|
|
8
|
+
import VRadioGroup from './VRadio/VRadioGroup.vue';
|
|
9
|
+
import VRadioItem from './VRadio/VRadioItem.vue';
|
|
10
|
+
import VRadioLabel from './VRadio/VRadioLabel.vue';
|
|
11
11
|
|
|
12
|
-
import VSwitch from
|
|
13
|
-
import VSwitchDescription from
|
|
14
|
-
import VSwitchGroup from
|
|
15
|
-
import VSwitchLabel from
|
|
12
|
+
import VSwitch from './VSwitch/VSwitch.vue';
|
|
13
|
+
import VSwitchDescription from './VSwitch/VSwitchDescription.vue';
|
|
14
|
+
import VSwitchGroup from './VSwitch/VSwitchGroup.vue';
|
|
15
|
+
import VSwitchLabel from './VSwitch/VSwitchLabel.vue';
|
|
16
16
|
|
|
17
17
|
export {
|
|
18
18
|
VAvatar,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { describe, expect, it, vi } from
|
|
2
|
-
import * as index from
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import * as index from './index';
|
|
3
3
|
|
|
4
|
-
describe(
|
|
4
|
+
describe('src', () => {
|
|
5
5
|
Object.entries(index).forEach(([key, value]) => {
|
|
6
6
|
it(`${key} is defined`, () => {
|
|
7
7
|
expect(value).toBeDefined();
|
package/src/components/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './atoms';
|
|
2
|
+
export * from './molecules';
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
import { mount } from
|
|
2
|
-
import { describe, expect, test } from
|
|
3
|
-
import { VAccordion } from
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import { describe, expect, test } from 'vitest';
|
|
3
|
+
import { VAccordion } from '..';
|
|
4
4
|
|
|
5
|
-
describe(
|
|
6
|
-
test(
|
|
5
|
+
describe('VAccordion', () => {
|
|
6
|
+
test('defaults', async () => {
|
|
7
7
|
const wrapper = mount({
|
|
8
8
|
template: /*html*/ `<v-accordion></v-accordion>`,
|
|
9
9
|
components: {
|
|
10
|
-
|
|
10
|
+
'v-accordion': VAccordion,
|
|
11
11
|
},
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
expect(wrapper.classes()).toEqual([
|
|
15
|
-
"vuetiful-accordion",
|
|
16
|
-
"flex",
|
|
17
|
-
"w-full",
|
|
18
|
-
"flex-col",
|
|
19
|
-
"gap-1",
|
|
20
|
-
]);
|
|
14
|
+
expect(wrapper.classes()).toEqual(['vuetiful-accordion', 'flex', 'w-full', 'flex-col', 'gap-1']);
|
|
21
15
|
});
|
|
22
16
|
|
|
23
|
-
test(
|
|
17
|
+
test('unstyled', async () => {
|
|
24
18
|
const wrapper = mount({
|
|
25
19
|
template: /*html*/ `<v-accordion unstyled></v-accordion>`,
|
|
26
20
|
components: {
|
|
27
|
-
|
|
21
|
+
'v-accordion': VAccordion,
|
|
28
22
|
},
|
|
29
23
|
});
|
|
30
24
|
|
|
31
|
-
expect(wrapper.classes()).toEqual([
|
|
32
|
-
})
|
|
25
|
+
expect(wrapper.classes()).toEqual(['vuetiful-accordion']);
|
|
26
|
+
});
|
|
33
27
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useSettings } from '@/services';
|
|
3
|
-
import { provide
|
|
3
|
+
import { provide } from 'vue';
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
classQuestion: {
|
|
@@ -21,8 +21,8 @@ const props = defineProps({
|
|
|
21
21
|
provide('classQuestion', props.classQuestion);
|
|
22
22
|
provide('classAnswer', props.classAnswer);
|
|
23
23
|
|
|
24
|
-
const { settings } = useSettings()
|
|
25
|
-
const isUnstyled =
|
|
24
|
+
const { settings } = useSettings();
|
|
25
|
+
const isUnstyled = settings.global.unstyled || settings.components.accordion.unstyled || props.unstyled;
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
<template>
|