@webitel/ui-sdk 3.2.83 → 3.2.85
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/ui-sdk.common.js +80 -2
- package/dist/ui-sdk.common.js.map +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.umd.js +80 -2
- package/dist/ui-sdk.umd.js.map +1 -1
- package/dist/ui-sdk.umd.min.js +1 -1
- package/dist/ui-sdk.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/index.js +2 -0
- package/src/components/organisms/wt-stepper/__tests__/WtStepper.spec.vue.js +18 -0
- package/src/components/organisms/wt-stepper/wt-stepper.vue +85 -0
- package/src/locale/en/en.js +2 -0
- package/src/locale/ru/ru.js +2 -0
- package/src/locale/ua/ua.js +2 -0
- package/src/mixins/validationMixin/validationMixin.js +1 -0
package/package.json
CHANGED
package/src/components/index.js
CHANGED
|
@@ -55,6 +55,7 @@ import WtTableActions from './organisms/wt-table-actions/wt-table-actions.vue';
|
|
|
55
55
|
import WtTableColumnSelect from './organisms/wt-table-column-select/wt-table-column-select.vue';
|
|
56
56
|
import WtIconAction from './organisms/wt-icon-action/wt-icon-action.vue';
|
|
57
57
|
import WtPageHeader from './organisms/wt-page-header/wt-page-header.vue';
|
|
58
|
+
import WtStepper from './organisms/wt-stepper/wt-stepper.vue';
|
|
58
59
|
|
|
59
60
|
const Components = {
|
|
60
61
|
WtAvatar,
|
|
@@ -111,6 +112,7 @@ const Components = {
|
|
|
111
112
|
WtPageHeader,
|
|
112
113
|
WtItemLink,
|
|
113
114
|
WtDummy,
|
|
115
|
+
WtStepper,
|
|
114
116
|
};
|
|
115
117
|
|
|
116
118
|
export default Components;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { shallowMount } from '@vue/test-utils';
|
|
2
|
+
import WtStepper from '../wt-stepper.vue';
|
|
3
|
+
|
|
4
|
+
describe('WtStepper', () => {
|
|
5
|
+
it('renders a component', () => {
|
|
6
|
+
const wrapper = shallowMount(WtStepper, {
|
|
7
|
+
props: {
|
|
8
|
+
steps: [
|
|
9
|
+
{
|
|
10
|
+
name: 'step 1',
|
|
11
|
+
description: 'description',
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
expect(wrapper.isVisible()).toBe(true);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="wt-stepper">
|
|
3
|
+
<div class="wt-stepper-header">
|
|
4
|
+
<div
|
|
5
|
+
class="wt-stepper-steps"
|
|
6
|
+
>
|
|
7
|
+
<div
|
|
8
|
+
class="wt-stepper-steps__wrapper"
|
|
9
|
+
v-for="({name, completed}, idx) in stepWithCompleted"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
v-if="idx !== 0"
|
|
13
|
+
class="wt-stepper-steps__divider"
|
|
14
|
+
:class="{ 'wt-stepper-steps__divider--completed': completed }"
|
|
15
|
+
></div>
|
|
16
|
+
<wt-chip
|
|
17
|
+
class="wt-stepper-steps__item"
|
|
18
|
+
:color="!completed && 'secondary'"
|
|
19
|
+
>{{ name }}
|
|
20
|
+
</wt-chip>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<slot name="description">
|
|
26
|
+
<p class="wt-stepper-description">{{ description }}</p>
|
|
27
|
+
</slot>
|
|
28
|
+
|
|
29
|
+
<slot name="main"></slot>
|
|
30
|
+
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
<script setup>
|
|
34
|
+
import { computed } from 'vue';
|
|
35
|
+
|
|
36
|
+
const props = defineProps({
|
|
37
|
+
steps: {
|
|
38
|
+
type: Object,
|
|
39
|
+
},
|
|
40
|
+
activeStep: {
|
|
41
|
+
type: Number,
|
|
42
|
+
default: 1,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const description = computed(() => props.steps[props.activeStep - 1].description);
|
|
47
|
+
|
|
48
|
+
const stepWithCompleted = computed(() => props.steps.map((item, idx) => ({
|
|
49
|
+
...item,
|
|
50
|
+
completed: props.activeStep > idx,
|
|
51
|
+
})));
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style lang="scss" scoped>
|
|
55
|
+
.wt-stepper-header {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: var(--spacing-lg);
|
|
59
|
+
margin-bottom: var(--spacing-lg);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.wt-stepper-steps {
|
|
63
|
+
display: flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
|
|
66
|
+
&__wrapper {
|
|
67
|
+
display: contents;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&__divider {
|
|
71
|
+
flex: 1 1 auto;
|
|
72
|
+
height: 1px;
|
|
73
|
+
background: var(--secondary-color);
|
|
74
|
+
|
|
75
|
+
&--completed {
|
|
76
|
+
background-color: var(--chip-bg-color);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.wt-stepper-description {
|
|
82
|
+
margin-bottom: var(--spacing-lg);
|
|
83
|
+
text-align: center;
|
|
84
|
+
}
|
|
85
|
+
</style>
|
package/src/locale/en/en.js
CHANGED
package/src/locale/ru/ru.js
CHANGED
package/src/locale/ua/ua.js
CHANGED
|
@@ -31,6 +31,7 @@ export default {
|
|
|
31
31
|
else if (this.v.minLength?.$invalid) validationText = `${this.$t('validation.minLength')} ${this.v.minLength.$params.min}`;
|
|
32
32
|
else if (this.v.url?.$invalid) validationText = `${this.$t('validation.url')}`;
|
|
33
33
|
else if (this.v.regExpValidator?.$invalid) validationText = `${this.$t('validation.regExpValidator')}`;
|
|
34
|
+
else if (this.v.sameAs?.$invalid) validationText = `${this.$t('validation.sameAs')}`;
|
|
34
35
|
}
|
|
35
36
|
// eslint-disable-next-line no-restricted-syntax
|
|
36
37
|
for (const { name, text } of this.customValidators) {
|