@webitel/ui-sdk 23.9.1 → 23.12.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.
Files changed (60) hide show
  1. package/dist/ui-sdk.common.js +11155 -445
  2. package/dist/ui-sdk.common.js.map +1 -1
  3. package/dist/ui-sdk.css +1 -1
  4. package/dist/ui-sdk.umd.js +11307 -597
  5. package/dist/ui-sdk.umd.js.map +1 -1
  6. package/dist/ui-sdk.umd.min.js +8 -8
  7. package/dist/ui-sdk.umd.min.js.map +1 -1
  8. package/package.json +9 -4
  9. package/src/components/wt-app-header/_variables.scss +1 -0
  10. package/src/components/wt-app-header/wt-app-header.vue +1 -1
  11. package/src/components/wt-button/Readme.md +23 -0
  12. package/src/components/wt-button/_variables.scss +53 -30
  13. package/src/components/wt-button/wt-button.vue +45 -147
  14. package/src/components/wt-button-select/Readme.md +13 -0
  15. package/src/components/wt-button-select/_variables.scss +0 -11
  16. package/src/components/wt-button-select/wt-button-select.vue +33 -92
  17. package/src/components/wt-checkbox/wt-checkbox.vue +8 -2
  18. package/src/components/wt-context-menu/wt-context-menu.vue +4 -1
  19. package/src/components/wt-datepicker/wt-datepicker.vue +9 -3
  20. package/src/components/wt-icon/Readme.md +327 -0
  21. package/src/components/wt-icon/_variables.scss +26 -0
  22. package/src/components/wt-icon/docs/cleanup-svg-fill-none.png +0 -0
  23. package/src/components/wt-icon/docs/cleanup-svg-fill.png +0 -0
  24. package/src/components/wt-icon/docs/cleanup-svg-viewbox-correct.png +0 -0
  25. package/src/components/wt-icon/docs/cleanup-svg-viewbox-incorrect.png +0 -0
  26. package/src/components/wt-icon/docs/cleanup-svg-width-height.png +0 -0
  27. package/src/components/wt-icon/docs/svg-icon-code-example.png +0 -0
  28. package/src/components/wt-icon/docs/svg-sprite-in-dom.png +0 -0
  29. package/src/components/wt-icon/wt-icon.vue +72 -87
  30. package/src/components/wt-icon-action/_internals/wt-edit-icon-action.vue +0 -1
  31. package/src/components/wt-icon-btn/Readme.md +10 -0
  32. package/src/components/wt-icon-btn/_variables.scss +9 -0
  33. package/src/components/wt-icon-btn/wt-icon-btn.vue +27 -62
  34. package/src/components/wt-input/wt-input.vue +8 -5
  35. package/src/components/wt-navigation-bar/wt-navigation-bar.vue +2 -2
  36. package/src/components/wt-page-header/wt-page-header.vue +3 -3
  37. package/src/components/wt-pagination/__tests__/WtPagination.spec.js +2 -1
  38. package/src/components/wt-radio/wt-radio.vue +4 -1
  39. package/src/components/wt-rounded-action/Readme.md +68 -0
  40. package/src/components/wt-rounded-action/_variables.scss +42 -4
  41. package/src/components/wt-rounded-action/wt-rounded-action.vue +139 -107
  42. package/src/components/wt-select/wt-select.vue +15 -6
  43. package/src/components/wt-switcher/wt-switcher.vue +5 -2
  44. package/src/components/wt-tabs/wt-tabs.vue +4 -1
  45. package/src/components/wt-tags-input/wt-tags-input.vue +11 -5
  46. package/src/components/wt-textarea/wt-textarea.vue +5 -2
  47. package/src/components/wt-time-input/wt-time-input.vue +5 -2
  48. package/src/components/wt-timepicker/wt-timepicker.vue +1 -1
  49. package/src/css/styleguide/colors/_colors.scss +170 -148
  50. package/src/css/styleguide/colors/_deprecated.scss +151 -0
  51. package/src/css/styleguide/colors/_palette.scss +2 -2
  52. package/src/directives/clickaway/clickaway.js +2 -51
  53. package/src/directives/index.js +0 -1
  54. package/src/locale/en/en.js +1 -0
  55. package/src/locale/ru/ru.js +1 -0
  56. package/src/locale/ua/ua.js +1 -0
  57. package/src/modules/AuditForm/components/audit-form-question-read-wrapper.vue +10 -0
  58. package/src/modules/AuditForm/components/questions/options/__tests__/audit-form-question-options-write-row.spec.js +1 -1
  59. package/src/modules/QueryFilters/components/abstract-api-filter.vue +1 -1
  60. package/src/modules/QueryFilters/components/abstract-enum-filter.vue +1 -1
@@ -1,162 +1,194 @@
1
1
  <template>
2
- <wt-button
3
- v-bind="{ ...$attrs, ...$props }"
2
+ <button
4
3
  :class="[
5
4
  `wt-rounded-action--color-${color}`,
5
+ `wt-rounded-action--size-${size}`,
6
6
  { 'wt-rounded-action--active': active },
7
7
  { 'wt-rounded-action--disabled': disabled },
8
- { 'wt-rounded-action--filled': filled },
8
+ { 'wt-rounded-action--rounded': rounded },
9
+ { 'wt-rounded-action--wide': wide },
9
10
  ]"
10
- :size="size"
11
- color="secondary"
11
+ type="button"
12
12
  class="wt-rounded-action"
13
- @click="$emit('click', $event)"
13
+ @click="emit('click', $event)"
14
14
  >
15
+ <wt-loader
16
+ v-if="loading"
17
+ size="sm"
18
+ :color="loaderColor"
19
+ ></wt-loader>
15
20
  <wt-icon
21
+ v-else
16
22
  :color="iColor"
17
23
  :icon="icon"
18
24
  :size="size"
19
25
  ></wt-icon>
20
- </wt-button>
26
+ </button>
21
27
  </template>
22
28
 
23
- <script>
24
- export default {
25
- name: 'wt-rounded-action',
26
- props: {
27
- icon: {
28
- type: String,
29
- },
30
- color: {
31
- type: String,
32
- options: ['secondary', 'accent', 'success', 'danger', 'hold', 'transfer'],
33
- },
34
- iconColor: {
35
- type: String,
36
- default: null,
37
- },
38
- size: {
39
- type: String,
40
- default: 'md',
41
- options: ['sm', 'md'],
42
- },
43
- active: {
44
- type: Boolean,
45
- default: false,
46
- },
47
- disabled: {
48
- type: Boolean,
49
- default: false,
50
- },
51
- filled: {
52
- type: Boolean,
53
- default: false,
54
- },
29
+ <script setup>
30
+ import { computed } from 'vue';
31
+
32
+ const props = defineProps({
33
+ icon: {
34
+ type: String,
35
+ required: true,
36
+ },
37
+ /**
38
+ * @values 'primary', 'secondary', 'success', 'error', 'transfer'
39
+ */
40
+ color: {
41
+ type: String,
42
+ options: ['primary', 'secondary', 'success', 'error', 'transfer'],
43
+ default: 'secondary',
44
+ },
45
+ /**
46
+ * @values 'sm', 'md'
47
+ */
48
+ size: {
49
+ type: String,
50
+ default: 'md',
51
+ },
52
+ active: {
53
+ type: Boolean,
54
+ default: false,
55
+ },
56
+ disabled: {
57
+ type: Boolean,
58
+ default: false,
59
+ },
60
+ rounded: {
61
+ type: Boolean,
62
+ default: false,
63
+ },
64
+ /**
65
+ * Stretches button to all available width
66
+ */
67
+ wide: {
68
+ type: Boolean,
69
+ default: false,
55
70
  },
56
- emits: ['click'],
57
- computed: {
58
- iColor() {
59
- if (this.iconColor) return this.iconColor;
60
- if (this.disabled) return 'secondary-50';
61
- if (this.color === 'secondary') return null; // dont change icon color
62
- if (this.filled && this.color) return 'contrast';
63
- return this.color;
64
- },
71
+ loading: {
72
+ type: Boolean,
73
+ default: false,
65
74
  },
66
- };
75
+ });
76
+ const emit = defineEmits(['click']);
77
+
78
+ const iColor = computed(() => {
79
+ const onDark = ['success', 'error', 'transfer'];
80
+ const onLight = ['primary'];
81
+ if (props.disabled) return 'disabled';
82
+ if (onDark.includes(props.color)) return 'on-dark';
83
+ if (onLight.includes(props.color)) return 'on-light';
84
+ if (props.active) return 'default';
85
+ return 'default';
86
+ });
87
+ const loaderColor = computed(() => {
88
+ if (['success', 'transfer', 'error'].includes(props.color)) return 'main';
89
+ return 'contrast';
90
+ });
67
91
  </script>
68
92
 
69
93
  <style lang="scss">
70
94
  @import './variables.scss';
71
95
  </style>
72
96
 
73
- <!--not scoped to change .icon colors-->
74
97
  <style lang="scss" scoped>
75
-
76
- .wt-button.wt-rounded-action {
77
- min-width: auto;
78
- min-height: 0;
79
- padding: var(--rounded-action-padding);
98
+ .wt-rounded-action {
99
+ display: block;
100
+ width: fit-content;
80
101
  line-height: 0;
81
- border: var(--btn-border);
82
- border-color: transparent;
83
- background: var(--rounded-action-bg-color);
102
+ padding: var(--rounded-action-padding);
84
103
  box-shadow: var(--elevation-1);
104
+ border: var(--rounded-action-border-size) solid;
105
+ background: var(--rounded-action-secondary-color);
106
+ border-color: var(--rounded-action-secondary-color);
107
+ border-radius: var(--border-radius);
108
+ transition: var(--transition);
85
109
 
86
110
  &:hover {
87
- background: var(--rounded-action-bg-color); // override default wt-button hover
88
111
  box-shadow: var(--elevation-2);
89
112
  }
90
113
 
91
- &--active {
92
- border-color: var(--icon-color);
93
-
94
- &.wt-rounded-action--color-secondary {
95
- border-color: var(--icon-color);
96
- }
97
-
98
- &.wt-rounded-action--color-accent {
99
- border-color: var(--btn-accent--hover-color);
100
- }
114
+ &--wide {
115
+ width: 100%;
116
+ }
101
117
 
102
- &.wt-rounded-action--color-success {
103
- border-color: var(--btn-true--hover-color);
104
- }
118
+ &--rounded {
119
+ border-radius: var(--rounded-action-rounded-border-radius);
120
+ }
105
121
 
106
- &.wt-rounded-action--color-danger {
107
- border-color: var(--btn-false--hover-color);
108
- }
122
+ &--color {
123
+ &-primary {
124
+ background: var(--rounded-action-primary-color);
125
+ border-color: var(--rounded-action-primary-color);
109
126
 
110
- &.wt-rounded-action--color-hold {
111
- border-color: var(--btn-hold--hover-color);
127
+ &:hover {
128
+ background: var(--rounded-action-primary-hover-color);
129
+ border-color: var(--rounded-action-primary-hover-color);
130
+ }
112
131
  }
113
132
 
114
- &.wt-rounded-action--color-transfer {
115
- border-color: var(--btn-transfer--hover-color);
116
- }
117
- }
133
+ &-secondary {
134
+ background: var(--rounded-action-secondary-color);
135
+ border-color: var(--rounded-action-secondary-color);
118
136
 
119
- &--filled {
137
+ &:hover {
138
+ background: var(--rounded-action-secondary-hover-color);
139
+ border-color: var(--rounded-action-secondary-hover-color);
140
+ }
120
141
 
121
- &:hover {
122
- box-shadow: var(--elevation-5);
123
- border-color: var(--rounded-action-bg-color);
142
+ &.wt-rounded-action--active {
143
+ background: transparent;
144
+ border-color: var(--rounded-action-secondary-active-color);
145
+ }
124
146
  }
125
147
 
126
- &.wt-rounded-action--color-secondary {
127
- background-color: var(--btn-secondary-color);
128
- border-color: var(--btn-secondary-color);
129
- }
148
+ &-success {
149
+ background: var(--rounded-action-success-color);
150
+ border-color: var(--rounded-action-success-color);
130
151
 
131
- &.wt-rounded-action--color-accent {
132
- background-color: var(--btn-accent--hover-color);
133
- border-color: var(--btn-accent--hover-color);
152
+ &:hover {
153
+ background: var(--rounded-action-success-hover-color);
154
+ border-color: var(--rounded-action-success-hover-color);
155
+ }
134
156
  }
135
157
 
136
- &.wt-rounded-action--color-success {
137
- background-color: var(--btn-true--hover-color);
138
- border-color: var(--btn-true--hover-color);
139
- }
158
+ &-error {
159
+ background: var(--rounded-action-error-color);
160
+ border-color: var(--rounded-action-error-color);
140
161
 
141
- &.wt-rounded-action--color-danger {
142
- background-color: var(--btn-false--hover-color);
143
- border-color: var(--btn-false--hover-color);
162
+ &:hover {
163
+ background: var(--rounded-action-error-hover-color);
164
+ border-color: var(--rounded-action-error-hover-color);
165
+ }
144
166
  }
145
167
 
146
- &.wt-rounded-action--color-hold {
147
- background-color: var(--btn-false--hover-color);
148
- border-color: var(--btn-false--hover-color);
149
- }
168
+ &-transfer {
169
+ background: var(--rounded-action-transfer-color);
170
+ border-color: var(--rounded-action-transfer-color);
150
171
 
151
- &.wt-rounded-action--color-transfer {
152
- background-color: var(--btn-false--hover-color);
153
- border-color: var(--btn-false--hover-color);
172
+ &:hover {
173
+ background: var(--rounded-action-transfer-hover-color);
174
+ border-color: var(--rounded-action-transfer-hover-color);
175
+ }
154
176
  }
155
177
  }
156
178
 
157
179
  &.wt-rounded-action--disabled {
158
- border-color: transparent;
180
+ background: var(--rounded-action-disabled-color);
181
+ border-color: var(--rounded-action-disabled-color);
159
182
  box-shadow: none;
183
+ pointer-events: none;
184
+ }
185
+
186
+ &--size {
187
+ &-sm {
188
+ }
189
+
190
+ &-md {
191
+ }
160
192
  }
161
193
  }
162
194
  </style>
@@ -10,16 +10,20 @@
10
10
  class="wt-select"
11
11
  >
12
12
  <wt-label
13
+ v-bind="labelProps"
13
14
  v-if="hasLabel"
14
15
  :disabled="disabled"
15
16
  :invalid="invalid"
16
17
  class="wt-select__label"
17
- v-bind="labelProps"
18
18
  >
19
19
  <!-- @slot Custom input label -->
20
- <slot name="label" v-bind="{ label }">{{ requiredLabel }}</slot>
20
+ <slot
21
+ v-bind="{ label }"
22
+ name="label"
23
+ >{{ requiredLabel }}</slot>
21
24
  </wt-label>
22
25
  <vue-multiselect
26
+ v-bind="$attrs"
23
27
  ref="vue-multiselect"
24
28
  :allow-empty="allowEmpty"
25
29
  :disabled="disabled"
@@ -33,7 +37,6 @@
33
37
  :track-by="trackBy"
34
38
  :model-value="selectValue"
35
39
  class="wt-select__select"
36
- v-bind="$attrs"
37
40
  @close="isOpened = false"
38
41
  @open="isOpened = true"
39
42
  v-on="listeners"
@@ -51,7 +54,10 @@
51
54
 
52
55
  <!-- Slot for custom label template for single select-->
53
56
  <template v-slot:singleLabel="{ option }">
54
- <slot name="singleLabel" v-bind="{ option, optionLabel }">
57
+ <slot
58
+ v-bind="{ option, optionLabel }"
59
+ name="singleLabel"
60
+ >
55
61
  <span class="multiselect__single-label">
56
62
  {{ getOptionLabel({ option, optionLabel }) }}
57
63
  </span>
@@ -60,7 +66,10 @@
60
66
 
61
67
  <!-- Slot for custom option template -->
62
68
  <template v-slot:option="{ option }">
63
- <slot name="option" v-bind="{ option, optionLabel }">
69
+ <slot
70
+ v-bind="{ option, optionLabel }"
71
+ name="option"
72
+ >
64
73
  {{ getOptionLabel({ option, optionLabel }) }}
65
74
  </slot>
66
75
  </template>
@@ -72,7 +81,7 @@
72
81
  :disabled="disabled"
73
82
  class="multiselect__select"
74
83
  icon="arrow-down"
75
- @mousedown.native.prevent.stop="toggle"
84
+ @mousedown.prevent.stop="toggle"
76
85
  ></wt-icon-btn>
77
86
  </template>
78
87
 
@@ -8,9 +8,9 @@
8
8
  }"
9
9
  >
10
10
  <wt-label
11
+ v-bind="labelProps"
11
12
  class="wt-switcher__wrapper"
12
13
  :class="{'wt-switcher__wrapper--label-left': labelLeft}"
13
- v-bind="labelProps"
14
14
  >
15
15
  <input
16
16
  class="wt-switcher__input"
@@ -21,7 +21,10 @@
21
21
  >
22
22
  <span class="wt-switcher__checkmark"></span>
23
23
  <!-- @slot Custom input label -->
24
- <slot name="label" v-bind="{ label, value, disabled }">
24
+ <slot
25
+ v-bind="{ label, value, disabled }"
26
+ name="label"
27
+ >
25
28
  <div v-if="label" class="wt-switcher__label">{{ label }}</div>
26
29
  </slot>
27
30
  </wt-label>
@@ -11,7 +11,10 @@
11
11
  type="button"
12
12
  @click="open(tab)"
13
13
  >
14
- <slot :name="tab.value" v-bind="{ tab, current }">
14
+ <slot
15
+ v-bind="{ tab, current }"
16
+ :name="tab.value"
17
+ >
15
18
  <span style="display: block;">{{ tab.text }}</span>
16
19
  </slot>
17
20
  </button>
@@ -8,17 +8,21 @@
8
8
  class="wt-tags-input"
9
9
  >
10
10
  <wt-label
11
+ v-bind="labelProps"
11
12
  v-if="hasLabel"
12
13
  :disabled="disabled"
13
14
  :invalid="invalid"
14
15
  class="wt-tags-input__label"
15
- v-bind="labelProps"
16
16
  >
17
17
  <!-- @slot Custom input label -->
18
- <slot name="label" v-bind="{ label }">{{ requiredLabel }}</slot>
18
+ <slot
19
+ v-bind="{ label }"
20
+ name="label"
21
+ >{{ requiredLabel }}</slot>
19
22
  </wt-label>
20
23
 
21
24
  <vue-multiselect
25
+ v-bind="$attrs"
22
26
  ref="vue-multiselect"
23
27
  :close-on-select="false"
24
28
  :disabled="disabled"
@@ -32,7 +36,6 @@
32
36
  :model-value="selectValue"
33
37
  class="wt-tags-input__select"
34
38
  multiple
35
- v-bind="$attrs"
36
39
  v-on="listeners"
37
40
  >
38
41
 
@@ -50,7 +53,10 @@
50
53
 
51
54
  <!-- Slot for custom option template -->
52
55
  <template v-slot:option="{ option }">
53
- <slot name="option" v-bind="{ option, optionLabel }">
56
+ <slot
57
+ v-bind="{ option, optionLabel }"
58
+ name="option"
59
+ >
54
60
  {{ getTagOptionLabel({ option, optionLabel }) }}
55
61
  </slot>
56
62
  </template>
@@ -63,7 +69,7 @@
63
69
  class="multiselect__select"
64
70
  color="active"
65
71
  icon="arrow-down"
66
- @mousedown.native.prevent.stop="toggle"
72
+ @mousedown.prevent.stop="toggle"
67
73
  ></wt-icon-btn>
68
74
  </template>
69
75
 
@@ -7,13 +7,16 @@
7
7
  }"
8
8
  >
9
9
  <wt-label
10
+ v-bind="labelProps"
10
11
  :for="name"
11
12
  :disabled="disabled"
12
13
  :invalid="invalid"
13
- v-bind="labelProps"
14
14
  >
15
15
  <!-- @slot Custom input label -->
16
- <slot name="label" v-bind="{ label }">{{ requiredLabel }}</slot>
16
+ <slot
17
+ v-bind="{ label }"
18
+ name="label"
19
+ >{{ requiredLabel }}</slot>
17
20
  </wt-label>
18
21
  <div class="wt-textarea__wrapper">
19
22
  <textarea
@@ -8,15 +8,18 @@
8
8
  }"
9
9
  >
10
10
  <wt-label
11
+ v-bind="labelProps"
11
12
  v-if="hasLabel"
12
13
  :for="name"
13
14
  :outline="outline"
14
15
  :disabled="disabled"
15
16
  :invalid="invalid"
16
- v-bind="labelProps"
17
17
  >
18
18
  <!-- @slot Custom input label -->
19
- <slot name="label" v-bind="{ label }">{{ label }}</slot>
19
+ <slot
20
+ v-bind="{ label }"
21
+ name="label"
22
+ >{{ label }}</slot>
20
23
  </wt-label>
21
24
  <div class="wt-time-input__wrapper">
22
25
  <input
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div class="wt-timepicker" :class="{'wt-timepicker--invalid': invalid}">
3
3
  <wt-label
4
+ v-bind="labelProps"
4
5
  v-if="label"
5
6
  :invalid="invalid"
6
- v-bind="labelProps"
7
7
  >
8
8
  {{ `${label} (${format})` }}
9
9
  </wt-label>