@webitel/ui-sdk 24.10.45 → 24.10.46-1

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": "24.10.45",
3
+ "version": "24.10.46-1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -143,7 +143,7 @@
143
143
  "vite-plugin-static-copy": "^0.17.1",
144
144
  "vite-plugin-svg-sprite": "^0.5.1",
145
145
  "vite-plugin-vue-docgen": "^0.3.4",
146
- "vitepress": "=1.0.0-rc.26",
146
+ "vitepress": "1.4.1",
147
147
  "vitest": "^1.4.0",
148
148
  "vue": "^3.4.15",
149
149
  "vuex": "^4.1.0"
@@ -25,10 +25,7 @@ export default {
25
25
  },
26
26
  tooltips: {
27
27
  type: Object,
28
- default: () => ({
29
- copy: '',
30
- copied: '',
31
- }),
28
+ default: () => ({}),
32
29
  },
33
30
  },
34
31
  data: () => ({
@@ -44,16 +41,12 @@ export default {
44
41
  },
45
42
  methods: {
46
43
  async copy() {
47
- try {
48
- await copy(this.value);
49
- this.copied = this.value;
50
- if (copiedIdTimeout) window.clearTimeout(copiedIdTimeout);
51
- copiedIdTimeout = setTimeout(() => {
52
- this.copied = null;
53
- }, 1500);
54
- } catch (err) {
55
- throw err;
56
- }
44
+ await copy(this.value);
45
+ this.copied = this.value;
46
+ if (copiedIdTimeout) window.clearTimeout(copiedIdTimeout);
47
+ copiedIdTimeout = setTimeout(() => {
48
+ this.copied = null;
49
+ }, 1500);
57
50
  },
58
51
  },
59
52
  };
@@ -26,7 +26,7 @@
26
26
  @click="sort(col)"
27
27
  >
28
28
  <div class="wt-table__th__text">
29
- {{ col.text }}
29
+ {{ col.text || col.value }}
30
30
  </div>
31
31
  <wt-icon
32
32
  v-if="sortable"
@@ -76,6 +76,7 @@ export default {
76
76
  back: 'Back',
77
77
  step: 'Step { count }',
78
78
  more: 'More',
79
+ read: 'Read',
79
80
  },
80
81
  // yak zhe ya zaebalsya povtoriaty odni i ti sami slova!!!!
81
82
  vocabulary: {
@@ -76,6 +76,7 @@ export default {
76
76
  back: 'Назад',
77
77
  step: 'Шаг { count }',
78
78
  more: 'Больше',
79
+ read: 'Читать',
79
80
  },
80
81
  vocabulary: {
81
82
  language: 'Язык',
@@ -77,6 +77,7 @@ export default {
77
77
  back: 'Назад',
78
78
  step: 'Крок { count }',
79
79
  more: 'Більше',
80
+ read: 'Читати',
80
81
  },
81
82
  vocabulary: {
82
83
  language: 'Мова',
@@ -16,15 +16,15 @@ export const kebabToSnake = (str) =>
16
16
  export const snakeToKebab = (str) =>
17
17
  str.replace(/([-_][a-z])/g, (group) => group.replace('_', '-'));
18
18
 
19
- export const objSnakeToCamel = (obj, skipKeys = []) => {
19
+ const convertObject = ({ self, converter }) => (obj, skipKeys) => {
20
20
  if (!obj) return obj;
21
21
  const newObj = {};
22
22
  if (Array.isArray(obj)) {
23
23
  return obj.map((value) => {
24
24
  if (typeof value === 'object') {
25
- return objSnakeToCamel(value, skipKeys);
25
+ return self(value, skipKeys);
26
26
  }
27
- if (typeof value === 'string') return snakeToCamel(value);
27
+ if (typeof value === 'string') return converter(value);
28
28
  return value; // number
29
29
  });
30
30
  }
@@ -32,13 +32,13 @@ export const objSnakeToCamel = (obj, skipKeys = []) => {
32
32
  if (skipKeys.includes(oldKey)) {
33
33
  newObj[oldKey] = obj[oldKey];
34
34
  } else {
35
- const newKey = snakeToCamel(oldKey);
35
+ const newKey = converter(oldKey);
36
36
  let value = obj[oldKey];
37
37
  if (
38
38
  Array.isArray(value) ||
39
39
  (value !== null && value !== undefined && value.constructor === Object)
40
40
  ) {
41
- value = objSnakeToCamel(value, skipKeys);
41
+ value = self(value, skipKeys);
42
42
  }
43
43
  newObj[newKey] = value;
44
44
  }
@@ -47,33 +47,23 @@ export const objSnakeToCamel = (obj, skipKeys = []) => {
47
47
  return newObj;
48
48
  };
49
49
 
50
+ export const objSnakeToCamel = (obj, skipKeys = []) => {
51
+ return convertObject({
52
+ self: objSnakeToCamel,
53
+ converter: snakeToCamel,
54
+ })(obj, skipKeys);
55
+ };
56
+
50
57
  export const objCamelToSnake = (obj, skipKeys = []) => {
51
- if (!obj) return obj;
52
- const newObj = {};
53
- if (Array.isArray(obj)) {
54
- return obj.map((value) => {
55
- if (typeof value === 'object') {
56
- return objCamelToSnake(value, skipKeys);
57
- }
58
- if (typeof value === 'string') return camelToSnake(value);
59
- return value; // number
60
- });
61
- }
62
- Object.keys(obj).forEach((oldKey) => {
63
- if (skipKeys.includes(oldKey)) {
64
- newObj[oldKey] = obj[oldKey];
65
- } else {
66
- const newKey = camelToSnake(oldKey);
67
- let value = obj[oldKey];
68
- if (
69
- Array.isArray(value) ||
70
- (value !== null && value !== undefined && value.constructor === Object)
71
- ) {
72
- value = objCamelToSnake(value, skipKeys);
73
- }
74
- newObj[newKey] = value;
75
- }
76
- });
58
+ return convertObject({
59
+ self: objCamelToSnake,
60
+ converter: camelToSnake,
61
+ })(obj, skipKeys);
62
+ };
77
63
 
78
- return newObj;
64
+ export const objCamelToKebab = (obj, skipKeys = []) => {
65
+ return convertObject({
66
+ self: objCamelToKebab,
67
+ converter: camelToKebab,
68
+ })(obj, skipKeys);
79
69
  };