@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "3.2.83",
3
+ "version": "3.2.85",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -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>
@@ -66,6 +66,8 @@ export default {
66
66
  all: 'All {entity}',
67
67
  upload: 'Upload',
68
68
  edit: 'Edit',
69
+ back: 'Back',
70
+ step: 'Step { count }',
69
71
  },
70
72
  // yak zhe ya zaebalsya povtoriaty odni i ti sami slova!!!!
71
73
  vocabulary: {
@@ -66,6 +66,8 @@ export default {
66
66
  all: 'Все {entity}',
67
67
  upload: 'Загрузить',
68
68
  edit: 'Редактировать',
69
+ back: 'Назад',
70
+ step: 'Шаг { count }',
69
71
  },
70
72
  vocabulary: {
71
73
  language: 'Язык',
@@ -67,6 +67,8 @@ export default {
67
67
  all: 'Всі {entity}',
68
68
  upload: 'Завантажити',
69
69
  edit: 'Редагувати',
70
+ back: 'Назад',
71
+ step: 'Крок { count }',
70
72
  },
71
73
  vocabulary: {
72
74
  language: 'Мова',
@@ -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) {