@webitel/ui-sdk 2.1.13 → 2.1.15

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.13",
3
+ "version": "2.1.15",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve-lib": "vue-cli-service serve",
@@ -23,7 +23,7 @@
23
23
  :close-on-select="false"
24
24
  :disabled="disabled"
25
25
  :internal-search="!searchMethod"
26
- :label="trackBy ? optionLabel : null"
26
+ :label="trackBy ? (optionLabel || trackBy) : null"
27
27
  :loading="false"
28
28
  :options="selectOptions"
29
29
  :placeholder="placeholder || label"
@@ -125,6 +125,15 @@ export default {
125
125
  [this.trackBy]: id || searchQuery,
126
126
  } : searchQuery;
127
127
 
128
+ const isTagExist = (newTag) => {
129
+ if (typeof newTag === 'string') {
130
+ return this.options.some((elem) => elem === newTag);
131
+ }
132
+ return this.options.some((elem) => elem[this.trackBy] === newTag[this.trackBy]);
133
+ }
134
+
135
+ if (isTagExist(tag)) return;
136
+
128
137
  this.options.unshift(tag);
129
138
  if (!this.manualTagging) {
130
139
  const value = [...this.value, tag];