@webitel/ui-sdk 2.0.16-8 → 2.0.17

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": "2.0.16-8",
3
+ "version": "2.0.17",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -29,7 +29,7 @@ export default {
29
29
  color: {
30
30
  type: String,
31
31
  default: 'default',
32
- options: ['default', 'contrast', 'active', 'accent', 'disabled', 'success', 'danger', 'transfer', 'job', 'hold', 'secondary-50'],
32
+ options: ['default', 'contrast', 'active', 'accent', 'secondary', 'disabled', 'success', 'danger', 'transfer', 'job', 'hold', 'secondary-50'],
33
33
  },
34
34
  iconPrefix: {
35
35
  type: String,
@@ -85,6 +85,10 @@ svg {
85
85
  fill: var(--icon-color-active);
86
86
  }
87
87
 
88
+ &-secondary .wt-icon__icon {
89
+ fill: var(--secondary-color);
90
+ }
91
+
88
92
  &-success .wt-icon__icon {
89
93
  fill: var(--icon-color-success);
90
94
  }
@@ -115,6 +115,7 @@
115
115
  }
116
116
 
117
117
  .wt-search-bar__search-icon {
118
+ line-height: 0;
118
119
  position: absolute;
119
120
  top: 50%;
120
121
  left: var(--input-icon-margin);
@@ -39,7 +39,7 @@
39
39
  <!-- Slot that is used for all selected options (tags)-->
40
40
  <template slot="tag" slot-scope="{ option }">
41
41
  <span class="multiselect__custom-tag">
42
- {{ option[optionLabel] || option }}
42
+ {{ getOptionLabel({ option, optionLabel }) }}
43
43
  </span>
44
44
  </template>
45
45
 
@@ -141,7 +141,6 @@ export default {
141
141
 
142
142
  optionLabel: {
143
143
  type: String,
144
- default: 'name',
145
144
  },
146
145
 
147
146
  searchMethod: {
@@ -226,11 +225,14 @@ export default {
226
225
 
227
226
  methods: {
228
227
  getOptionLabel({ option, optionLabel }) {
228
+ const defaultOptionLabel = 'name';
229
+
230
+ if (optionLabel) return option[optionLabel];
229
231
  if (option.locale) {
230
232
  if (Array.isArray(option.locale)) return this.$tc(...option.locale);
231
233
  return this.$t(option.locale);
232
234
  }
233
- return option[optionLabel] || option;
235
+ return option[defaultOptionLabel] || option;
234
236
  },
235
237
  handleSearchChange(search) {
236
238
  if (!this.isApiMode) return;
@@ -39,6 +39,7 @@ export default {
39
39
  tts: 'Text-to-Speech',
40
40
  state: 'State',
41
41
  refresh: 'Refresh',
42
+ retry: 'Retry',
42
43
  },
43
44
  // yak zhe ya zaebalsya povtoriaty odni i ti sami slova!!!!
44
45
  vocabulary: {
@@ -39,6 +39,7 @@ export default {
39
39
  tts: 'Text-to-Speech',
40
40
  state: 'Состояние',
41
41
  refresh: 'Обновить',
42
+ retry: 'Повторить',
42
43
  },
43
44
  vocabulary: {
44
45
  language: 'Язык',
@@ -39,6 +39,7 @@ export default {
39
39
  tts: 'Text-to-Speech',
40
40
  state: 'Стан',
41
41
  refresh: 'Оновити',
42
+ retry: 'Повторити',
42
43
  },
43
44
  vocabulary: {
44
45
  language: 'Мова',
@@ -2,6 +2,8 @@ import {
2
2
  camelToKebab,
3
3
  camelToSnake,
4
4
  kebabToCamel,
5
+ snakeToKebab,
6
+ kebabToSnake,
5
7
  objCamelToSnake,
6
8
  objSnakeToCamel,
7
9
  snakeToCamel,
@@ -15,6 +17,13 @@ describe('Case converters', () => {
15
17
  expect(kebabToCamel(kebabStr)).toBe(camelStr);
16
18
  });
17
19
 
20
+ it('Snake-Kebab', () => {
21
+ const snakeStr = 'snake_to_kebab';
22
+ const kebabStr = 'snake-to-kebab';
23
+ expect(snakeToKebab(snakeStr)).toBe(kebabStr);
24
+ expect(kebabToSnake(kebabStr)).toBe(snakeStr);
25
+ });
26
+
18
27
  it('Camel-Snake', () => {
19
28
  const camelStr = 'camelToSnake';
20
29
  const snakeStr = 'camel_to_snake';
@@ -20,6 +20,18 @@ export const camelToKebab = (str) => str.replace(
20
20
  .replace('', '-'),
21
21
  );
22
22
 
23
+ export const kebabToSnake = (str) => str.replace(
24
+ /([-_][a-z])/g,
25
+ (group) => group
26
+ .replace('-', '_'),
27
+ );
28
+
29
+ export const snakeToKebab = (str) => str.replace(
30
+ /([-_][a-z])/g,
31
+ (group) => group
32
+ .replace('_', '-'),
33
+ );
34
+
23
35
  export const objSnakeToCamel = (obj, skipKeys = []) => {
24
36
  if (!obj) return obj;
25
37
  const newObj = {};