@vcita/design-system 0.2.7 → 0.3.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/CHANGELOG.MD +10 -0
- package/README.md +1 -0
- package/dist/@vcita/design-system.esm.js +715 -424
- package/dist/@vcita/design-system.min.js +1 -1
- package/dist/@vcita/design-system.ssr.js +645 -369
- package/init/DesignSystem.js +18 -2
- package/init/SvgIcons.js +4 -0
- package/init/vuetify.config.js +3 -3
- package/package.json +1 -1
- package/src/components/VcActionList/VcActionList.spec.js +1 -1
- package/src/components/VcActionList/VcActionList.stories.js +1 -1
- package/src/components/VcActions/VcActions.spec.js +1 -1
- package/src/components/VcActions/VcActions.stories.js +1 -1
- package/src/components/VcActions/VcActions.vue +4 -6
- package/src/components/VcBanner/VcBanner.stories.js +14 -2
- package/src/components/VcBanner/VcBanner.vue +5 -2
- package/src/components/VcBottomActions/VcBottomActions.spec.js +1 -1
- package/src/components/VcBottomActions/VcBottomActions.stories.js +3 -3
- package/src/components/VcEmptyState/VcEmptyState.vue +1 -1
- package/src/components/VcExpansionCard/VcExpansionCard.spec.js +146 -0
- package/src/components/VcExpansionCard/VcExpansionCard.stories.js +43 -0
- package/src/components/VcExpansionCard/VcExpansionCard.vue +117 -0
- package/src/components/VcSwitch/VcSwitch.spec.js +40 -0
- package/src/components/VcSwitch/VcSwitch.stories.js +14 -3
- package/src/components/VcSwitch/VcSwitch.vue +162 -52
- package/src/components/index.js +2 -0
- package/src/components/list/VcListEntity/VcListEntity.spec.js +95 -0
- package/src/components/list/VcListEntity/VcListEntity.stories.js +77 -0
- package/src/components/list/VcListEntity/VcListEntity.vue +70 -0
- package/src/components/modal/VcConfirmModal/VcConfirmModal.vue +6 -2
- package/src/components/wizard/VcSteperContent/VcStepperContent.vue +6 -0
- package/src/components/wizard/VcWizard/VcWizard.spec.js +7 -0
- package/src/components/wizard/VcWizard/VcWizard.stories.js +3 -0
- package/src/components/wizard/VcWizard/VcWizard.vue +12 -4
- package/src/components/wizard/VcWizard/demoWizardPage.vue +1 -1
- package/src/stories/welcome.stories.mdx +1 -0
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<div class="switchContainer" :class="{'with-icon': icon}">
|
|
2
3
|
<v-switch inset hide-details
|
|
3
4
|
class="VcSwitch"
|
|
4
|
-
:class="{'is-active': value,}"
|
|
5
|
+
:class="{'is-active': value, 'with-icon': icon}"
|
|
5
6
|
:label="label"
|
|
6
7
|
:ripple="ripple"
|
|
7
8
|
:input-value="value"
|
|
8
9
|
:color="color"
|
|
9
10
|
:disabled="disabled"
|
|
10
|
-
@change="
|
|
11
|
+
@change="onChange">
|
|
11
12
|
<template #label>
|
|
12
13
|
<slot name="label"/>
|
|
13
14
|
</template>
|
|
14
15
|
</v-switch>
|
|
16
|
+
<VcIcon v-if="icon&value" class="VcSwitchIcon VcSwitchIconV" size="10">$check_button</VcIcon>
|
|
17
|
+
<VcIcon v-if="icon&!value" class="VcSwitchIcon VcSwitchIconX" size="10">$close_button</VcIcon>
|
|
18
|
+
</div>
|
|
15
19
|
</template>
|
|
16
20
|
|
|
17
21
|
<script>
|
|
22
|
+
import VcIcon from '../VcIcon/VcIcon.vue'
|
|
18
23
|
export default {
|
|
24
|
+
components: { VcIcon },
|
|
19
25
|
name: "VcSwitch",
|
|
20
26
|
props: {
|
|
21
27
|
value: {
|
|
@@ -37,85 +43,189 @@ export default {
|
|
|
37
43
|
disabled: {
|
|
38
44
|
type: Boolean,
|
|
39
45
|
default: false
|
|
46
|
+
},
|
|
47
|
+
icon: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
40
50
|
}
|
|
41
51
|
},
|
|
52
|
+
methods:{
|
|
53
|
+
onChange: function (id) {
|
|
54
|
+
this.$emit('input', id)
|
|
55
|
+
}
|
|
56
|
+
}
|
|
42
57
|
}
|
|
43
58
|
</script>
|
|
44
59
|
|
|
45
60
|
<style lang="scss" scoped>
|
|
46
61
|
@import "../../scss/_i18n-mixins.scss";
|
|
47
62
|
|
|
48
|
-
.
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
.switchContainer{
|
|
64
|
+
|
|
65
|
+
& .VcSwitch {
|
|
66
|
+
padding: 0;
|
|
67
|
+
margin: 0;
|
|
51
68
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
69
|
+
::v-deep {
|
|
70
|
+
label {
|
|
71
|
+
font-size: var(--font-size-small);
|
|
72
|
+
font-weight: var(--font-weight-medium);
|
|
73
|
+
line-height: var(--size-value6);
|
|
74
|
+
color: rgba(0, 0, 0, 0.87);
|
|
75
|
+
}
|
|
59
76
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
77
|
+
input {
|
|
78
|
+
height: var(--size-value5);
|
|
79
|
+
}
|
|
63
80
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
81
|
+
.v-input--selection-controls__input {
|
|
82
|
+
@include i-margin-mirror(0, var(--size-value3));
|
|
83
|
+
height: var(--size-value5);
|
|
84
|
+
width: var(--size-value8);
|
|
85
|
+
}
|
|
86
|
+
.v-input--switch__track {
|
|
87
|
+
top: 0;
|
|
88
|
+
@include i-position-mirror(left, 0);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.v-input--selection-controls__ripple {
|
|
92
|
+
@include i-position-mirror(left, -10px);
|
|
93
|
+
height: 25px;
|
|
94
|
+
width: 25px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.v-input--switch__thumb {
|
|
98
|
+
height: 14px;
|
|
99
|
+
width: 14px;
|
|
100
|
+
background-color: #fff;
|
|
101
|
+
top: calc(50% - 7px);
|
|
102
|
+
@include i-translate-x(3px, '!');
|
|
103
|
+
box-shadow: var(--shadow-5);
|
|
104
|
+
}
|
|
72
105
|
}
|
|
73
106
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
107
|
+
&.v-input--is-disabled{
|
|
108
|
+
::v-deep {
|
|
109
|
+
opacity: 1;
|
|
110
|
+
.v-input--switch__track{
|
|
111
|
+
color: var(--gray-lighten-2) !important;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.v-input--switch__thumb{
|
|
115
|
+
background-color: var(--gray) !important;
|
|
116
|
+
box-shadow: none;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
78
119
|
}
|
|
79
120
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
121
|
+
&.is-active {
|
|
122
|
+
::v-deep {
|
|
123
|
+
.v-input--switch__track {
|
|
124
|
+
opacity: 1;
|
|
125
|
+
background-color: currentColor;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.v-input--selection-controls__ripple {
|
|
129
|
+
@include i-translate-x(14px, '!');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.v-input--switch__thumb {
|
|
133
|
+
@include i-translate-x(17px, '!');
|
|
134
|
+
}
|
|
135
|
+
}
|
|
87
136
|
}
|
|
88
|
-
}
|
|
89
137
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
138
|
+
&.with-icon {
|
|
139
|
+
::v-deep {
|
|
140
|
+
|
|
141
|
+
input {
|
|
142
|
+
height: var(--size-value6);
|
|
95
143
|
}
|
|
96
144
|
|
|
97
|
-
.v-input--
|
|
98
|
-
|
|
99
|
-
|
|
145
|
+
.v-input--selection-controls__input {
|
|
146
|
+
@include i-margin-mirror(0, var(--size-value3));
|
|
147
|
+
height: var(--size-value6);
|
|
148
|
+
width: var(--size-value12);
|
|
100
149
|
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
&.is-active {
|
|
105
|
-
::v-deep {
|
|
106
150
|
.v-input--switch__track {
|
|
107
|
-
|
|
108
|
-
|
|
151
|
+
top: 0;
|
|
152
|
+
@include i-position-mirror(left, 0);
|
|
153
|
+
height: var(--size-value6);
|
|
154
|
+
width: var(--size-value12);
|
|
109
155
|
}
|
|
110
156
|
|
|
111
157
|
.v-input--selection-controls__ripple {
|
|
112
|
-
@include i-
|
|
158
|
+
@include i-position-mirror(left, -9px);
|
|
159
|
+
height: 29px;
|
|
160
|
+
width: 29px;
|
|
161
|
+
top: calc(50% - 21.5px);
|
|
113
162
|
}
|
|
114
163
|
|
|
115
164
|
.v-input--switch__thumb {
|
|
116
|
-
|
|
165
|
+
height: 18px;
|
|
166
|
+
width: 18px;
|
|
167
|
+
top: calc(50% - 9px);
|
|
168
|
+
@include i-translate-x(3.5px, '!');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&.v-input--is-disabled{
|
|
173
|
+
::v-deep {
|
|
174
|
+
opacity: 1;
|
|
175
|
+
.v-input--switch__track{
|
|
176
|
+
color: var(--gray-lighten-2) !important;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.v-input--switch__thumb{
|
|
180
|
+
background-color: var(--gray) !important;
|
|
181
|
+
box-shadow: none;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
& + .VcSwitchIcon{
|
|
186
|
+
fill: var(--gray-lighten-2) !important;
|
|
117
187
|
}
|
|
118
188
|
}
|
|
189
|
+
|
|
190
|
+
&.is-active {
|
|
191
|
+
::v-deep {
|
|
192
|
+
.v-input--switch__track {
|
|
193
|
+
opacity: 1;
|
|
194
|
+
background-color: currentColor;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.v-input--selection-controls__ripple {
|
|
198
|
+
@include i-translate-x(23.5px, '!');
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.v-input--switch__thumb {
|
|
202
|
+
@include i-translate-x(26px, '!');
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
& .VcSwitchIcon{
|
|
211
|
+
position: relative;
|
|
212
|
+
}
|
|
213
|
+
& .VcSwitchIconV{
|
|
214
|
+
left: 30px;
|
|
215
|
+
top: -47px;
|
|
216
|
+
margin-bottom: -47px;
|
|
217
|
+
fill: var(--v-secondary-base);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
& .VcSwitchIconX{
|
|
221
|
+
left: 7.4px;
|
|
222
|
+
top: -51px;
|
|
223
|
+
margin-bottom: -51px;
|
|
224
|
+
fill: var(--neutral-lighten-1);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
&.with-icon{
|
|
228
|
+
height: var(--size-value6);
|
|
119
229
|
}
|
|
120
230
|
}
|
|
121
231
|
|
package/src/components/index.js
CHANGED
|
@@ -21,6 +21,8 @@ export {default as VcIcon} from './VcIcon/VcIcon.vue';
|
|
|
21
21
|
export {default as VcLayout} from './VcLayout/VcLayout.vue';
|
|
22
22
|
export {default as VcLoader} from './VcLoader/VcLoader.vue';
|
|
23
23
|
export {default as VcSwitch} from './VcSwitch/VcSwitch.vue';
|
|
24
|
+
export {default as VcListEntity} from './list/VcListEntity/VcListEntity.vue';
|
|
25
|
+
export {default as VcExpansionCard} from './VcExpansionCard/VcExpansionCard.vue';
|
|
24
26
|
export {default as VcTextField} from './VcTextField/VcTextField.vue';
|
|
25
27
|
export {default as VcAvatar} from './VcAvatar/VcAvatar.vue';
|
|
26
28
|
export {default as VcTextArea} from './VcTextArea/VcTextArea.vue';
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import '@testing-library/jest-dom';
|
|
2
|
+
import VcListEntity from "./VcListEntity.vue";
|
|
3
|
+
import init from "../../../../testing-library.config"
|
|
4
|
+
import Vuetify from 'vuetify';
|
|
5
|
+
import {render} from "@testing-library/vue";
|
|
6
|
+
import {fireEvent} from '@testing-library/dom'
|
|
7
|
+
|
|
8
|
+
init();
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const props = {
|
|
12
|
+
basic: {
|
|
13
|
+
title: 'first entity',
|
|
14
|
+
value: true
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
describe("VcListEntity.vue", () => {
|
|
19
|
+
|
|
20
|
+
const renderWithVuetify = (component, options, callback) => {
|
|
21
|
+
const root = document.createElement('div')
|
|
22
|
+
root.setAttribute('data-app', 'true')
|
|
23
|
+
|
|
24
|
+
return render(
|
|
25
|
+
component,
|
|
26
|
+
{
|
|
27
|
+
container: document.body.appendChild(root),
|
|
28
|
+
// for Vuetify components that use the vuetify instance property
|
|
29
|
+
vuetify: new Vuetify(),
|
|
30
|
+
...options,
|
|
31
|
+
mocks: {},
|
|
32
|
+
},
|
|
33
|
+
callback,
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
it("render VcListEntity", () => {
|
|
38
|
+
// Queries: https://testing-library.com/docs/queries/about#types-of-queries
|
|
39
|
+
const {container, getByTestId, getByText} = renderWithVuetify(VcListEntity, {
|
|
40
|
+
props: props.basic
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
// Expect options: https://github.com/testing-library/jest-dom
|
|
44
|
+
expect(container).toHaveAttribute('data-app', 'true')
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
const component = getByTestId('VcListEntity');
|
|
48
|
+
expect(component).toBeInTheDocument();
|
|
49
|
+
|
|
50
|
+
const title = getByText('first entity');
|
|
51
|
+
expect(title).toBeInTheDocument();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("render VcListEntity with icon slot", () => {
|
|
55
|
+
// Queries: https://testing-library.com/docs/queries/about#types-of-queries
|
|
56
|
+
const {container, getByTestId, getByText} = renderWithVuetify(VcListEntity, {
|
|
57
|
+
props: props.basic,
|
|
58
|
+
slots: {
|
|
59
|
+
icon: '<div>icon</div>',
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
// Expect options: https://github.com/testing-library/jest-dom
|
|
64
|
+
expect(container).toHaveAttribute('data-app', 'true')
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const component = getByTestId('VcListEntity');
|
|
68
|
+
expect(component).toBeInTheDocument();
|
|
69
|
+
|
|
70
|
+
const title = getByText('first entity');
|
|
71
|
+
expect(title).toBeInTheDocument();
|
|
72
|
+
|
|
73
|
+
const slotIcon = getByText('icon');
|
|
74
|
+
expect(slotIcon).toBeInTheDocument();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('event emitted',async () => {
|
|
78
|
+
const {emitted,getByRole} = renderWithVuetify(VcListEntity, {
|
|
79
|
+
props: props.basic,
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
const switchName = getByRole('switch');
|
|
83
|
+
expect(switchName).toBeInTheDocument();
|
|
84
|
+
expect(switchName).toHaveAttribute('aria-checked',"true");
|
|
85
|
+
|
|
86
|
+
await fireEvent.click(switchName);
|
|
87
|
+
expect(switchName).toHaveAttribute('aria-checked',"false");
|
|
88
|
+
expect(emitted().input.length).toBe(1);
|
|
89
|
+
|
|
90
|
+
await fireEvent.click(switchName);
|
|
91
|
+
expect(switchName).toHaveAttribute('aria-checked',"true");
|
|
92
|
+
expect(emitted().input.length).toBe(2);
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import VcListEntityCmp from './VcListEntity.vue';
|
|
2
|
+
|
|
3
|
+
const Template = (args, {argTypes}) => ({
|
|
4
|
+
components: {VcListEntity: VcListEntityCmp},
|
|
5
|
+
props: Object.keys(argTypes),
|
|
6
|
+
data: () => ({
|
|
7
|
+
itemValue: true,
|
|
8
|
+
}),
|
|
9
|
+
template: `<div><VcListEntity :disabled="disabled" :value="itemValue" :title="title"></VcListEntity></div>`,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export const Playground = Template.bind({});
|
|
13
|
+
|
|
14
|
+
// Set default values
|
|
15
|
+
Playground.args = {
|
|
16
|
+
disabled: false,
|
|
17
|
+
value: false,
|
|
18
|
+
title:'text to <b>storybook</b>'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const TemplateDisabled = (args, {argTypes}) => ({
|
|
22
|
+
components: {VcListEntity: VcListEntityCmp},
|
|
23
|
+
props: Object.keys(argTypes),
|
|
24
|
+
data: () => ({
|
|
25
|
+
itemValue: true,
|
|
26
|
+
}),
|
|
27
|
+
template: '<div><VcListEntity :disabled="disabled" :value="itemValue" :title="title" /></div>',
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export const Disabled = TemplateDisabled.bind({});
|
|
31
|
+
|
|
32
|
+
// Set default values
|
|
33
|
+
Disabled.args = {
|
|
34
|
+
disabled: true,
|
|
35
|
+
value: false,
|
|
36
|
+
title:'text to <b>storybook</b>'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const TemplateWithSlot = (args, {argTypes}) => ({
|
|
40
|
+
components: {VcListEntity: VcListEntityCmp},
|
|
41
|
+
props: Object.keys(argTypes),
|
|
42
|
+
data: () => ({
|
|
43
|
+
itemValue: true,
|
|
44
|
+
}),
|
|
45
|
+
template: `<div><VcListEntity :disabled="disabled" :value="itemValue" :title="title" >
|
|
46
|
+
<template v-slot:icon>
|
|
47
|
+
<v-icon size="12">home</v-icon>
|
|
48
|
+
</template>
|
|
49
|
+
</VcListEntity>
|
|
50
|
+
</div>`,
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
export const WithSlot = TemplateWithSlot.bind({});
|
|
54
|
+
|
|
55
|
+
// Set default values
|
|
56
|
+
WithSlot.args = {
|
|
57
|
+
disabled: false,
|
|
58
|
+
value: false,
|
|
59
|
+
title:'text to <b>storybook</b>'
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
export default {
|
|
64
|
+
title: 'containers / list / VcListEntity',
|
|
65
|
+
id: 'VcListEntity',
|
|
66
|
+
component: VcListEntityCmp,
|
|
67
|
+
parameters: {
|
|
68
|
+
design: {
|
|
69
|
+
type: 'figma',
|
|
70
|
+
url: 'https://www.figma.com/file/xIOY6fBoA1wpy1tHv3i5js/vcita---ui-library?node-id=4133%3A39303',
|
|
71
|
+
},
|
|
72
|
+
status: {
|
|
73
|
+
type: 'stable', // 'beta' | 'stable' | 'deprecated' | 'releaseCandidate'
|
|
74
|
+
url: 'http://www.url.com/status', // will make the tag a link
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="container" class="listEntity" :data-qa="dataQa">
|
|
3
|
+
<v-container fluid>
|
|
4
|
+
<div class="d-flex flex-wrap justify-space-between align-center sl-row" :class="{'margin-start':$vuetify.breakpoint.mdAndUp}">
|
|
5
|
+
<div class="justify-start d-flex align-center">
|
|
6
|
+
<slot name="icon"></slot>
|
|
7
|
+
<div
|
|
8
|
+
class="sl-title"
|
|
9
|
+
v-html="title"
|
|
10
|
+
>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="d-flex justify-end">
|
|
14
|
+
<VcSwitch
|
|
15
|
+
:disabled="disabled"
|
|
16
|
+
:ripple="false"
|
|
17
|
+
v-model="value"
|
|
18
|
+
color="secondary"
|
|
19
|
+
@input="val => $emit('input', Boolean(val))"
|
|
20
|
+
>
|
|
21
|
+
</VcSwitch>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
</v-container>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
<script>
|
|
30
|
+
import VcIcon from '../../VcIcon/VcIcon.vue'
|
|
31
|
+
import VcSwitch from '../../VcSwitch/VcSwitch.vue';
|
|
32
|
+
export default {
|
|
33
|
+
components: { VcIcon, VcSwitch },
|
|
34
|
+
name: 'VcListEntity',
|
|
35
|
+
props: {
|
|
36
|
+
disabled: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
value: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
title: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: false,
|
|
47
|
+
},
|
|
48
|
+
dataQa: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'VcListEntity'
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<style lang="scss">
|
|
57
|
+
.listEntity{
|
|
58
|
+
& .sl-title{
|
|
59
|
+
font-size: var(--font-size-x-small);
|
|
60
|
+
line-height: var(--size-value4);
|
|
61
|
+
font-weight: var(--font-weight-medium2);
|
|
62
|
+
margin: 0 8px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
& .sl-row{
|
|
67
|
+
min-width: 100%;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
</style>
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
<VcModalFooter
|
|
17
17
|
direction="horizontal"
|
|
18
18
|
:buttons='[
|
|
19
|
-
{label: cancelButtonLabel || $dst("ds.modal.cancel"),event:"onCancelClicked",color:"white"},
|
|
20
|
-
{label: okButtonLabel || $dst("ds.modal.ok"),event:"onOkClicked",color:"secondary"}
|
|
19
|
+
{label: cancelButtonLabel || $dst("ds.modal.cancel"), event:"onCancelClicked", color:"white", loading},
|
|
20
|
+
{label: okButtonLabel || $dst("ds.modal.ok"), event:"onOkClicked", color:"secondary", loading}
|
|
21
21
|
]'
|
|
22
22
|
@onOkClicked="$emit('onOkClicked')"
|
|
23
23
|
@onCancelClicked="$emit('onCancelClicked')"
|
|
@@ -83,6 +83,10 @@ export default {
|
|
|
83
83
|
type: String,
|
|
84
84
|
required: false
|
|
85
85
|
},
|
|
86
|
+
loading: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: false
|
|
89
|
+
}
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
92
|
</script>
|
|
@@ -122,14 +122,20 @@ export default {
|
|
|
122
122
|
|
|
123
123
|
}
|
|
124
124
|
.layout-content {
|
|
125
|
+
padding: var(--size-value0) var(--size-value4);
|
|
125
126
|
@include md-and-up {
|
|
127
|
+
padding: revert;
|
|
126
128
|
padding-block-start: var(--size-value3);
|
|
127
129
|
padding-inline: var(--size-value10);
|
|
128
130
|
}
|
|
129
131
|
}
|
|
130
132
|
.stepper-header {
|
|
133
|
+
flex: 0;
|
|
131
134
|
margin-block-end: var(--size-value7);
|
|
135
|
+
padding: var(--size-value0) var(--size-value4);
|
|
132
136
|
@include md-and-up {
|
|
137
|
+
padding: revert;
|
|
138
|
+
flex: revert;
|
|
133
139
|
padding-block-start: var(--size-value3);
|
|
134
140
|
padding-inline: var(--size-value10);
|
|
135
141
|
}
|
|
@@ -120,6 +120,11 @@ describe("VcWizard.vue", () => {
|
|
|
120
120
|
props: {
|
|
121
121
|
steps: defaultSteps,
|
|
122
122
|
dataQa: 'vcWizard',
|
|
123
|
+
initialWizardData: {
|
|
124
|
+
textFieldValue: 'initial value'
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
|
|
123
128
|
}
|
|
124
129
|
})
|
|
125
130
|
const stepperElement = getByTestId("vc-steps-bar")
|
|
@@ -132,6 +137,8 @@ describe("VcWizard.vue", () => {
|
|
|
132
137
|
expect(nextButton).toHaveClass('v-btn--disabled')
|
|
133
138
|
|
|
134
139
|
const textInput = await findByTestId('text-input')
|
|
140
|
+
expect(textInput.value).toBe('initial value')
|
|
141
|
+
await userEvent.clear(textInput)
|
|
135
142
|
await userEvent.type(textInput, "1");
|
|
136
143
|
await userEvent.type(textInput, "2");
|
|
137
144
|
await userEvent.type(textInput, "3");
|
|
@@ -41,6 +41,10 @@ export default {
|
|
|
41
41
|
name: "VcWizard",
|
|
42
42
|
components: {VcStepsBar, VcStepperContent, VcMobileWizardProgress, VcWizardCtaContainer},
|
|
43
43
|
props: {
|
|
44
|
+
initialWizardData: {
|
|
45
|
+
type: Object,
|
|
46
|
+
default: () => ({}),
|
|
47
|
+
},
|
|
44
48
|
steps: {
|
|
45
49
|
type: [Array],
|
|
46
50
|
validator: steps => steps.every(step => step.name),
|
|
@@ -87,13 +91,16 @@ export default {
|
|
|
87
91
|
if(this.currentStep < this.wizardSteps.length) {
|
|
88
92
|
this.currentStep++;
|
|
89
93
|
} else {
|
|
90
|
-
this.$emit('submit', this.
|
|
94
|
+
this.$emit('submit', this.wizardData)
|
|
91
95
|
}
|
|
92
96
|
},
|
|
93
97
|
},
|
|
94
98
|
computed: {
|
|
95
99
|
wizardData() {
|
|
96
|
-
return Object.values(this.wizardStepsData).reduce((acc, currentValue) =>
|
|
100
|
+
return Object.values(this.wizardStepsData).reduce((acc, currentValue) => {
|
|
101
|
+
Object.assign(acc,currentValue)
|
|
102
|
+
return acc
|
|
103
|
+
}, {...this.initialWizardData})
|
|
97
104
|
},
|
|
98
105
|
currentStepObj() {
|
|
99
106
|
return this.wizardSteps[this.currentStep - 1]
|
|
@@ -120,8 +127,8 @@ export default {
|
|
|
120
127
|
height: 100%;
|
|
121
128
|
@include md-and-up {
|
|
122
129
|
display: grid;
|
|
123
|
-
grid-template-columns: minmax(
|
|
124
|
-
grid-template-rows:
|
|
130
|
+
grid-template-columns: minmax(250px,1fr) 3fr;
|
|
131
|
+
grid-template-rows: 562px 80px;
|
|
125
132
|
grid-column-gap: var(--size-value10);
|
|
126
133
|
grid-row-gap: 0px;
|
|
127
134
|
}
|
|
@@ -133,6 +140,7 @@ export default {
|
|
|
133
140
|
.vc-stepper-container {
|
|
134
141
|
grid-area: 1 / 1 / 3 / 2;
|
|
135
142
|
border-inline-end: 1px solid #E0E0E0;
|
|
143
|
+
max-height: calc( 100% - 24px );
|
|
136
144
|
}
|
|
137
145
|
.wizard-cta-container {
|
|
138
146
|
grid-area: 2 / 2 / 3 / 3;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<v-btn @click="$emit('submit', {stepData: {backButtonLabel: 'new text'}} )" data-qa="test-button" class="demo-page-button">
|
|
4
4
|
demo button text
|
|
5
5
|
</v-btn>
|
|
6
|
-
<VcTextArea data-qa="text-input" class="text-input" placeholder="enter 123 to proceed" @input="(data) => $emit('submit', {wizardData: {textFieldValue: data}} )" >
|
|
6
|
+
<VcTextArea :value="textFieldValue" data-qa="text-input" class="text-input" placeholder="enter 123 to proceed" @input="(data) => $emit('submit', {wizardData: {textFieldValue: data}} )" >
|
|
7
7
|
|
|
8
8
|
</VcTextArea>
|
|
9
9
|
<v-layout>
|
|
@@ -179,6 +179,7 @@ Setting their values will allow you to control different aspects of the display
|
|
|
179
179
|
<div><code>--size-value7: 28px;</code></div>
|
|
180
180
|
<div><code>--size-value8: 32px;</code></div>
|
|
181
181
|
<div><code>--size-value10: 40px;</code></div>
|
|
182
|
+
<div><code>--size-value12: 48px;</code></div>
|
|
182
183
|
<div><code>--size-value16: 64px;</code></div>
|
|
183
184
|
|
|
184
185
|
|