@webitel/ui-sdk 2.0.16-9 → 2.0.19

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-9",
3
+ "version": "2.0.19",
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
  }
@@ -52,6 +52,7 @@ export default {
52
52
  iColor() {
53
53
  if (this.iconColor) return this.iconColor;
54
54
  if (this.disabled) return 'secondary-50';
55
+ if (this.color === 'secondary') return null; // dont change icon color
55
56
  return this.color;
56
57
  },
57
58
  },
@@ -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;
@@ -35,6 +35,7 @@ const AdminSections = Object.freeze({
35
35
  STORAGE: 'storage', // scope: storage_profile
36
36
  COGNITIVE_PROFILES: 'cognitive-profiles', // scope: cognitive_profile
37
37
  EMAIL_PROFILES: 'email-profiles', // scope: email_profile
38
+ IMPORT_CSV: 'import-csv',
38
39
 
39
40
  // PERMISSIONS
40
41
  OBJECTS: 'objects', // permissions: add
@@ -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: {
@@ -154,6 +155,7 @@ export default {
154
155
  [AdminSections.STORAGE]: 'Storage',
155
156
  [AdminSections.COGNITIVE_PROFILES]: 'Cognitive profiles',
156
157
  [AdminSections.EMAIL_PROFILES]: 'Email profiles',
158
+ [AdminSections.IMPORT_CSV]: 'Import data from CSV file',
157
159
  [AdminSections.MEDIA]: 'Media',
158
160
  [AdminSections.BLACKLIST]: 'Call lists',
159
161
  [AdminSections.ROLES]: 'Roles',
@@ -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: 'Язык',
@@ -153,6 +154,7 @@ export default {
153
154
  [AdminSections.STORAGE]: 'Хранилища',
154
155
  [AdminSections.COGNITIVE_PROFILES]: 'Языковые профили',
155
156
  [AdminSections.EMAIL_PROFILES]: 'Email профили',
157
+ [AdminSections.IMPORT_CSV]: 'Импорт данных из CSV файла',
156
158
  [AdminSections.ROLES]: 'Роли',
157
159
  [AdminSections.OBJECTS]: 'Разделы',
158
160
  },
@@ -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: 'Мова',
@@ -153,6 +154,7 @@ export default {
153
154
  [AdminSections.STORAGE]: 'Сховища',
154
155
  [AdminSections.COGNITIVE_PROFILES]: 'Мовні профілі',
155
156
  [AdminSections.EMAIL_PROFILES]: 'Email профілі',
157
+ [AdminSections.IMPORT_CSV]: 'Імпорт даних з CSV файлу',
156
158
  [AdminSections.ROLES]: 'Ролі',
157
159
  [AdminSections.OBJECTS]: 'Розділи',
158
160
  },
@@ -132,6 +132,10 @@ const applicationsAccess = (value = true) => ({
132
132
  _enabled: value,
133
133
  _locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.EMAIL_PROFILES}`,
134
134
  },
135
+ [AdminSections.IMPORT_CSV]: {
136
+ _enabled: value,
137
+ _locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.IMPORT_CSV}`,
138
+ },
135
139
  [AdminSections.ROLES]: {
136
140
  _enabled: value,
137
141
  _locale: `WebitelApplications.${WebitelApplications.ADMIN}.sections.${AdminSections.ROLES}`,
@@ -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 = {};