@webitel/ui-sdk 2.1.16 → 2.1.18

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.1.16",
3
+ "version": "2.1.18",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -54,6 +54,7 @@ export default {
54
54
  data: () => ({
55
55
  apiOptions: [],
56
56
  isLoading: false,
57
+ defaultOptionLabel: 'name',
57
58
 
58
59
  searchParams: {
59
60
  search: '',
@@ -96,14 +97,12 @@ export default {
96
97
 
97
98
  methods: {
98
99
  getOptionLabel({ option, optionLabel }) {
99
- const defaultOptionLabel = 'name';
100
-
101
100
  if (optionLabel) return option[optionLabel];
102
101
  if (option.locale) {
103
102
  if (Array.isArray(option.locale)) return this.$tc(...option.locale);
104
103
  return this.$t(option.locale);
105
104
  }
106
- return option[defaultOptionLabel] || option;
105
+ return option[this.defaultOptionLabel] || option;
107
106
  },
108
107
  handleSearchChange(search) {
109
108
  if (!this.isApiMode) return;
@@ -23,7 +23,7 @@
23
23
  :close-on-select="false"
24
24
  :disabled="disabled"
25
25
  :internal-search="!searchMethod"
26
- :label="trackBy ? (optionLabel || trackBy) : null"
26
+ :label="trackBy ? optionLabel : null"
27
27
  :loading="false"
28
28
  :options="selectOptions"
29
29
  :placeholder="placeholder || label"
@@ -115,7 +115,9 @@ export default {
115
115
  `,
116
116
  },
117
117
  },
118
-
118
+ data: () => ({
119
+ defaultOptionLabel: 'label',
120
+ }),
119
121
  methods: {
120
122
  tag(searchQuery, id) {
121
123
  this.$emit('tag', searchQuery, id);