@web-utils/component 2.0.13 → 2.0.14

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.
Files changed (172) hide show
  1. package/dist/chunks/3a79781b.js +75 -0
  2. package/dist/chunks/{44b78389.js → 41a066be.js} +8 -8
  3. package/dist/chunks/{e1939731.js → 5a78e0db.js} +5 -6
  4. package/dist/chunks/5d4282fb.js +30 -0
  5. package/dist/chunks/{822300f3.js → 61ad06b2.js} +3 -3
  6. package/dist/chunks/76680a03.js +24 -0
  7. package/dist/chunks/8c0142e0.js +81 -0
  8. package/dist/chunks/97652d86.js +26 -0
  9. package/dist/chunks/b4acd3a6.js +126 -0
  10. package/dist/chunks/f71045fc.js +184 -0
  11. package/dist/components/address-input/index.js +43 -56
  12. package/dist/components/address-input/style.css +1 -15
  13. package/dist/components/aside-menu/index.js +30 -36
  14. package/dist/components/aside-menu/style.css +1 -9
  15. package/dist/components/awesome-button/index.js +32 -35
  16. package/dist/components/base.css +1 -66
  17. package/dist/components/capsule-tab/index.js +27 -33
  18. package/dist/components/capsule-tab/style.css +1 -32
  19. package/dist/components/chunk-file-uploader/index.js +54 -88
  20. package/dist/components/chunk-file-uploader/style.css +1 -4
  21. package/dist/components/chunk-file-uploader-button/index.js +25 -31
  22. package/dist/components/chunk-file-uploader-button/style.css +1 -17
  23. package/dist/components/chunk-file-uploader-drop/index.js +28 -42
  24. package/dist/components/chunk-file-uploader-drop/style.css +1 -12
  25. package/dist/components/chunk-file-uploader-file/index.js +134 -211
  26. package/dist/components/chunk-file-uploader-file/style.css +1 -125
  27. package/dist/components/chunk-file-uploader-files/index.js +28 -34
  28. package/dist/components/chunk-file-uploader-files/style.css +1 -9
  29. package/dist/components/chunk-file-uploader-list/index.js +29 -35
  30. package/dist/components/chunk-file-uploader-list/style.css +1 -9
  31. package/dist/components/chunk-file-uploader-un-support/index.js +30 -38
  32. package/dist/components/chunk-file-uploader-un-support/style.css +1 -6
  33. package/dist/components/code-mirror-editor/index.js +153 -181
  34. package/dist/components/code-mirror-editor/style.css +1 -17
  35. package/dist/components/color-picker/index.js +49 -68
  36. package/dist/components/confirm-button/index.js +19 -21
  37. package/dist/components/confirmable/index.js +18 -19
  38. package/dist/components/context-menu/index.js +108 -130
  39. package/dist/components/context-menu/style.css +1 -88
  40. package/dist/components/custom-scrollbar/index.js +49 -67
  41. package/dist/components/data-table-picker/index.js +62 -81
  42. package/dist/components/dynamic-table/index.js +89 -113
  43. package/dist/components/dynamic-table/style.css +1 -30
  44. package/dist/components/e-charts/index.js +120 -201
  45. package/dist/components/e-charts/style.css +1 -10
  46. package/dist/components/editable-progress/index.js +60 -93
  47. package/dist/components/editable-progress/style.css +1 -37
  48. package/dist/components/editable-tree/index.js +423 -638
  49. package/dist/components/editable-tree/style.css +1 -82
  50. package/dist/components/egd-collapse/index.js +33 -46
  51. package/dist/components/egd-collapse-item/index.js +60 -76
  52. package/dist/components/element-dialog/index.js +95 -147
  53. package/dist/components/element-dialog/style.css +1 -102
  54. package/dist/components/empty-view/index.js +28 -34
  55. package/dist/components/empty-view/style.css +1 -17
  56. package/dist/components/error-view/index.js +26 -32
  57. package/dist/components/error-view/style.css +1 -17
  58. package/dist/components/flex-column/index.js +25 -40
  59. package/dist/components/flex-item/index.js +29 -57
  60. package/dist/components/flex-row/index.js +25 -40
  61. package/dist/components/flex-scroller/index.js +26 -32
  62. package/dist/components/flex-scroller/style.css +1 -20
  63. package/dist/components/form-button/index.js +34 -38
  64. package/dist/components/form-cascader/index.js +71 -81
  65. package/dist/components/form-checkbox-group/index.js +88 -113
  66. package/dist/components/form-checkbox-group/style.css +1 -51
  67. package/dist/components/form-date-picker/index.js +70 -132
  68. package/dist/components/form-holder/index.js +32 -39
  69. package/dist/components/form-input/index.js +56 -62
  70. package/dist/components/form-input-email/index.js +48 -60
  71. package/dist/components/form-input-id-card/index.js +53 -59
  72. package/dist/components/form-input-number/index.js +61 -68
  73. package/dist/components/form-input-number/style.css +1 -12
  74. package/dist/components/form-input-phone-number/index.js +49 -55
  75. package/dist/components/form-input-time/index.js +53 -59
  76. package/dist/components/form-item/index.js +80 -123
  77. package/dist/components/form-item/style.css +1 -11
  78. package/dist/components/form-item-config-provider/index.js +25 -26
  79. package/dist/components/form-item-group/index.js +85 -111
  80. package/dist/components/form-item-group/style.css +1 -30
  81. package/dist/components/form-radio-group/index.js +85 -104
  82. package/dist/components/form-radio-group/style.css +1 -53
  83. package/dist/components/form-select/index.js +76 -91
  84. package/dist/components/form-switch/index.js +51 -57
  85. package/dist/components/form-textarea/index.js +51 -57
  86. package/dist/components/form-view/index.js +165 -232
  87. package/dist/components/form-view/style.css +1 -158
  88. package/dist/components/guide-steps/index.js +44 -58
  89. package/dist/components/guide-steps/style.css +1 -34
  90. package/dist/components/icon-card/index.js +29 -35
  91. package/dist/components/icon-card/style.css +1 -56
  92. package/dist/components/iframe-window/index.js +29 -35
  93. package/dist/components/iframe-window/style.css +1 -20
  94. package/dist/components/image-viewer/index.js +48 -66
  95. package/dist/components/image-viewer/style.css +1 -21
  96. package/dist/components/input-number/index.js +127 -193
  97. package/dist/components/input-number/style.css +1 -15
  98. package/dist/components/input-number-range/index.js +45 -57
  99. package/dist/components/input-number-range/style.css +1 -12
  100. package/dist/components/j-s-x-component/index.js +4 -4
  101. package/dist/components/keep-view-alive/index.js +73 -120
  102. package/dist/components/loading-view/index.js +26 -32
  103. package/dist/components/loading-view/style.css +1 -17
  104. package/dist/components/nav-bar/index.js +27 -37
  105. package/dist/components/nav-bar/style.css +1 -17
  106. package/dist/components/not-implement/index.js +23 -31
  107. package/dist/components/not-implement/style.css +1 -15
  108. package/dist/components/page/index.js +22 -28
  109. package/dist/components/page/style.css +1 -12
  110. package/dist/components/page-header/index.js +30 -36
  111. package/dist/components/page-header/style.css +1 -14
  112. package/dist/components/page-index/index.js +62 -83
  113. package/dist/components/page-index/style.css +1 -23
  114. package/dist/components/page-index-top/index.js +53 -68
  115. package/dist/components/page-skeleton/index.js +31 -37
  116. package/dist/components/page-skeleton/style.css +1 -23
  117. package/dist/components/page-skeleton-new/index.js +42 -48
  118. package/dist/components/page-skeleton-new/style.css +1 -42
  119. package/dist/components/pageable-table/index.js +186 -253
  120. package/dist/components/pageable-table/style.css +1 -72
  121. package/dist/components/pageable-view/index.js +129 -199
  122. package/dist/components/pageable-view/style.css +1 -69
  123. package/dist/components/photo-swipe/index.js +110 -151
  124. package/dist/components/photo-swipe/style.css +1 -20
  125. package/dist/components/resize-observer/index.js +34 -68
  126. package/dist/components/resize-observer/style.css +1 -31
  127. package/dist/components/search-popover/index.js +153 -211
  128. package/dist/components/search-popover/style.css +1 -93
  129. package/dist/components/sign-panel/index.js +92 -142
  130. package/dist/components/sign-panel/style.css +1 -97
  131. package/dist/components/split-pane/index.js +101 -162
  132. package/dist/components/split-pane/style.css +1 -100
  133. package/dist/components/stateful/index.js +31 -34
  134. package/dist/components/stateful/style.css +1 -33
  135. package/dist/components/static-pageable-table/index.js +37 -44
  136. package/dist/components/static-pageable-table/style.css +1 -9
  137. package/dist/components/swiper/index.js +85 -150
  138. package/dist/components/swiper/style.css +1 -43
  139. package/dist/components/tab/index.js +54 -72
  140. package/dist/components/tab/style.css +1 -122
  141. package/dist/components/tab-item/index.js +30 -35
  142. package/dist/components/table-column/index.js +30 -32
  143. package/dist/components/table-view/index.js +156 -227
  144. package/dist/components/table-view/style.css +1 -95
  145. package/dist/components/tag-render/index.js +44 -58
  146. package/dist/components/tag-render/style.css +1 -33
  147. package/dist/components/tinymce-editor/index.js +79 -95
  148. package/dist/components/tinymce-editor/style.css +1 -43
  149. package/dist/components/tinymce-wrapper/index.js +92 -121
  150. package/dist/components/tinymce-wrapper/style.css +1 -36
  151. package/dist/components/toolbar/index.js +63 -84
  152. package/dist/components/toolbar/style.css +1 -39
  153. package/dist/components/toolbar-button/index.js +41 -48
  154. package/dist/components/toolbar-button/style.css +1 -21
  155. package/dist/components/trigger/index.js +29 -36
  156. package/dist/components/vue-tags-input/index.js +188 -308
  157. package/dist/components/vue-tags-input/style.css +1 -682
  158. package/dist/components/watermark/index.js +25 -37
  159. package/dist/components/watermark/style.css +1 -11
  160. package/dist/components/x-dialog/index.js +67 -93
  161. package/dist/components/x-dialog/style.css +1 -15
  162. package/dist/index.css +193 -1105
  163. package/dist/index.es.js +4790 -7243
  164. package/package.json +1 -1
  165. package/web-types.json +1 -1
  166. package/dist/chunks/3d28cc08.js +0 -57
  167. package/dist/chunks/5d33812d.js +0 -147
  168. package/dist/chunks/9d848bf6.js +0 -99
  169. package/dist/chunks/a0bb327b.js +0 -96
  170. package/dist/chunks/a8891d2c.js +0 -30
  171. package/dist/chunks/c69d5628.js +0 -248
  172. package/dist/chunks/de9fe802.js +0 -24
@@ -1,186 +1,162 @@
1
- import { n as normalizeComponent } from "../../chunks/3d28cc08.js";
2
- var render = function() {
3
- var _vm = this;
4
- var _h = _vm.$createElement;
5
- var _c = _vm._self._c || _h;
6
- return _c("div", {
1
+ import { n as l } from "../../chunks/5d4282fb.js";
2
+ var h = function() {
3
+ var e = this, s = e.$createElement, a = e._self._c || s;
4
+ return a("div", {
7
5
  staticClass: "tags-input-root"
8
- }, [_c("div", {
9
- class: `${_vm.wrapperClass} tags-input`
10
- }, [_vm._l(_vm.tags, function(tag, index) {
11
- return _c("span", {
12
- key: index,
6
+ }, [a("div", {
7
+ class: `${e.wrapperClass} tags-input`
8
+ }, [e._l(e.tags, function(t, i) {
9
+ return a("span", {
10
+ key: i,
13
11
  staticClass: "el-tag el-tag--medium el-tag--light"
14
- }, [_c("span", {
12
+ }, [a("span", {
15
13
  domProps: {
16
- "innerHTML": _vm._s(tag.value)
14
+ innerHTML: e._s(t.value)
17
15
  }
18
- }), _c("i", {
16
+ }), a("i", {
19
17
  staticClass: "tags-input-remove ov",
20
18
  attrs: {
21
- "href": "#"
19
+ href: "#"
22
20
  },
23
21
  on: {
24
- "click": function($event) {
25
- $event.preventDefault();
26
- return _vm.removeTag(index);
22
+ click: function(n) {
23
+ return n.preventDefault(), e.removeTag(i);
27
24
  }
28
25
  }
29
26
  })]);
30
- }), _c("input", {
27
+ }), a("input", {
31
28
  directives: [{
32
29
  name: "model",
33
30
  rawName: "v-model",
34
- value: _vm.input,
31
+ value: e.input,
35
32
  expression: "input"
36
33
  }],
37
34
  ref: "taginput",
38
35
  staticStyle: {
39
- "height": "28px",
36
+ height: "28px",
40
37
  "margin-top": "5px",
41
38
  "line-height": "28px"
42
39
  },
43
40
  attrs: {
44
- "type": "text",
45
- "placeholder": _vm.placeholder
41
+ type: "text",
42
+ placeholder: e.placeholder
46
43
  },
47
44
  domProps: {
48
- "value": _vm.input
45
+ value: e.input
49
46
  },
50
47
  on: {
51
- "keydown": [function($event) {
52
- if (!$event.type.indexOf("key") && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter"))
53
- return null;
54
- $event.preventDefault();
55
- return _vm.tagFromInput(false);
56
- }, function($event) {
57
- if (!$event.type.indexOf("key") && $event.keyCode !== 8)
58
- return null;
59
- return _vm.removeLastTag.apply(null, arguments);
60
- }, function($event) {
61
- if (!$event.type.indexOf("key") && _vm._k($event.keyCode, "down", 40, $event.key, ["Down", "ArrowDown"]))
62
- return null;
63
- return _vm.nextSearchResult.apply(null, arguments);
64
- }, function($event) {
65
- if (!$event.type.indexOf("key") && _vm._k($event.keyCode, "up", 38, $event.key, ["Up", "ArrowUp"]))
66
- return null;
67
- return _vm.prevSearchResult.apply(null, arguments);
68
- }, _vm.onKeyDown],
69
- "keyup": [_vm.onKeyUp, function($event) {
70
- if (!$event.type.indexOf("key") && _vm._k($event.keyCode, "esc", 27, $event.key, ["Esc", "Escape"]))
71
- return null;
72
- return _vm.clearSearchResults.apply(null, arguments);
48
+ keydown: [function(t) {
49
+ return !t.type.indexOf("key") && e._k(t.keyCode, "enter", 13, t.key, "Enter") ? null : (t.preventDefault(), e.tagFromInput(!1));
50
+ }, function(t) {
51
+ return !t.type.indexOf("key") && t.keyCode !== 8 ? null : e.removeLastTag.apply(null, arguments);
52
+ }, function(t) {
53
+ return !t.type.indexOf("key") && e._k(t.keyCode, "down", 40, t.key, ["Down", "ArrowDown"]) ? null : e.nextSearchResult.apply(null, arguments);
54
+ }, function(t) {
55
+ return !t.type.indexOf("key") && e._k(t.keyCode, "up", 38, t.key, ["Up", "ArrowUp"]) ? null : e.prevSearchResult.apply(null, arguments);
56
+ }, e.onKeyDown],
57
+ keyup: [e.onKeyUp, function(t) {
58
+ return !t.type.indexOf("key") && e._k(t.keyCode, "esc", 27, t.key, ["Esc", "Escape"]) ? null : e.clearSearchResults.apply(null, arguments);
73
59
  }],
74
- "focus": _vm.onFocus,
75
- "blur": _vm.onBlur,
76
- "value": _vm.tags,
77
- "input": function($event) {
78
- if ($event.target.composing)
79
- return;
80
- _vm.input = $event.target.value;
60
+ focus: e.onFocus,
61
+ blur: e.onBlur,
62
+ value: e.tags,
63
+ input: function(t) {
64
+ t.target.composing || (e.input = t.target.value);
81
65
  }
82
66
  }
83
- }), _vm.elementId ? _c("input", {
67
+ }), e.elementId ? a("input", {
84
68
  directives: [{
85
69
  name: "model",
86
70
  rawName: "v-model",
87
- value: _vm.hiddenInput,
71
+ value: e.hiddenInput,
88
72
  expression: "hiddenInput"
89
73
  }],
90
74
  attrs: {
91
- "id": _vm.elementId,
92
- "type": "hidden",
93
- "name": _vm.elementId
75
+ id: e.elementId,
76
+ type: "hidden",
77
+ name: e.elementId
94
78
  },
95
79
  domProps: {
96
- "value": _vm.hiddenInput
80
+ value: e.hiddenInput
97
81
  },
98
82
  on: {
99
- "input": function($event) {
100
- if ($event.target.composing)
101
- return;
102
- _vm.hiddenInput = $event.target.value;
83
+ input: function(t) {
84
+ t.target.composing || (e.hiddenInput = t.target.value);
103
85
  }
104
86
  }
105
- }) : _vm._e()], 2), _c("div", {
87
+ }) : e._e()], 2), a("div", {
106
88
  directives: [{
107
89
  name: "show",
108
90
  rawName: "v-show",
109
- value: _vm.searchResults.length,
91
+ value: e.searchResults.length,
110
92
  expression: "searchResults.length"
111
93
  }]
112
- }, [_vm.typeaheadStyle === "badges" ? _c("p", {
113
- class: `typeahead-${_vm.typeaheadStyle}`
114
- }, [!_vm.typeaheadHideDiscard ? _c("span", {
94
+ }, [e.typeaheadStyle === "badges" ? a("p", {
95
+ class: `typeahead-${e.typeaheadStyle}`
96
+ }, [e.typeaheadHideDiscard ? e._e() : a("span", {
115
97
  staticClass: "tags-input-badge typeahead-hide-btn tags-input-typeahead-item-default",
116
98
  domProps: {
117
- "textContent": _vm._s(_vm.discardSearchText)
99
+ textContent: e._s(e.discardSearchText)
118
100
  },
119
101
  on: {
120
- "click": function($event) {
121
- $event.preventDefault();
122
- return _vm.clearSearchResults.apply(null, arguments);
102
+ click: function(t) {
103
+ return t.preventDefault(), e.clearSearchResults.apply(null, arguments);
123
104
  }
124
105
  }
125
- }) : _vm._e(), _vm._l(_vm.searchResults, function(tag, index) {
126
- return _c("span", {
127
- key: index,
106
+ }), e._l(e.searchResults, function(t, i) {
107
+ return a("span", {
108
+ key: i,
128
109
  staticClass: "tags-input-badge",
129
110
  class: {
130
- "tags-input-typeahead-item-default": index != _vm.searchSelection,
131
- "tags-input-typeahead-item-highlighted-default": index == _vm.searchSelection
111
+ "tags-input-typeahead-item-default": i != e.searchSelection,
112
+ "tags-input-typeahead-item-highlighted-default": i == e.searchSelection
132
113
  },
133
114
  domProps: {
134
- "innerHTML": _vm._s(tag.value)
115
+ innerHTML: e._s(t.value)
135
116
  },
136
117
  on: {
137
- "mouseover": function($event) {
138
- _vm.searchSelection = index;
118
+ mouseover: function(n) {
119
+ e.searchSelection = i;
139
120
  },
140
- "mousedown": function($event) {
141
- $event.preventDefault();
142
- return _vm.tagFromSearchOnClick(tag);
121
+ mousedown: function(n) {
122
+ return n.preventDefault(), e.tagFromSearchOnClick(t);
143
123
  }
144
124
  }
145
125
  });
146
- })], 2) : _vm.typeaheadStyle === "dropdown" ? _c("ul", {
147
- class: `typeahead-${_vm.typeaheadStyle}`
148
- }, [!_vm.typeaheadHideDiscard ? _c("li", {
126
+ })], 2) : e.typeaheadStyle === "dropdown" ? a("ul", {
127
+ class: `typeahead-${e.typeaheadStyle}`
128
+ }, [e.typeaheadHideDiscard ? e._e() : a("li", {
149
129
  staticClass: "tags-input-typeahead-item-default typeahead-hide-btn",
150
130
  domProps: {
151
- "textContent": _vm._s(_vm.discardSearchText)
131
+ textContent: e._s(e.discardSearchText)
152
132
  },
153
133
  on: {
154
- "mousedown": function($event) {
155
- $event.preventDefault();
156
- return _vm.clearSearchResults.apply(null, arguments);
134
+ mousedown: function(t) {
135
+ return t.preventDefault(), e.clearSearchResults.apply(null, arguments);
157
136
  }
158
137
  }
159
- }) : _vm._e(), _vm._l(_vm.searchResults, function(tag, index) {
160
- return _c("li", {
161
- key: index,
138
+ }), e._l(e.searchResults, function(t, i) {
139
+ return a("li", {
140
+ key: i,
162
141
  class: {
163
- "tags-input-typeahead-item-default": index != _vm.searchSelection,
164
- "tags-input-typeahead-item-highlighted-default": index == _vm.searchSelection
142
+ "tags-input-typeahead-item-default": i != e.searchSelection,
143
+ "tags-input-typeahead-item-highlighted-default": i == e.searchSelection
165
144
  },
166
145
  domProps: {
167
- "innerHTML": _vm._s(tag.value)
146
+ innerHTML: e._s(t.value)
168
147
  },
169
148
  on: {
170
- "mouseover": function($event) {
171
- _vm.searchSelection = index;
149
+ mouseover: function(n) {
150
+ e.searchSelection = i;
172
151
  },
173
- "mousedown": function($event) {
174
- $event.preventDefault();
175
- return _vm.tagFromSearchOnClick(tag);
152
+ mousedown: function(n) {
153
+ return n.preventDefault(), e.tagFromSearchOnClick(t);
176
154
  }
177
155
  }
178
156
  });
179
- })], 2) : _vm._e()])]);
180
- };
181
- var staticRenderFns = [];
182
- const VueTagsInput_vue_vue_type_style_index_0_lang = "";
183
- const __vue2_script = {
157
+ })], 2) : e._e()])]);
158
+ }, u = [];
159
+ const o = {
184
160
  name: "VueTagsInput",
185
161
  props: {
186
162
  elementId: {
@@ -188,19 +164,15 @@ const __vue2_script = {
188
164
  },
189
165
  existingTags: {
190
166
  type: Array,
191
- default: () => {
192
- return [];
193
- }
167
+ default: () => []
194
168
  },
195
169
  value: {
196
170
  type: Array,
197
- default: () => {
198
- return [];
199
- }
171
+ default: () => []
200
172
  },
201
173
  typeahead: {
202
174
  type: Boolean,
203
- default: false
175
+ default: !1
204
176
  },
205
177
  typeaheadStyle: {
206
178
  type: String,
@@ -216,11 +188,11 @@ const __vue2_script = {
216
188
  },
217
189
  typeaheadAlwaysShow: {
218
190
  type: Boolean,
219
- default: false
191
+ default: !1
220
192
  },
221
193
  typeaheadHideDiscard: {
222
194
  type: Boolean,
223
- default: false
195
+ default: !1
224
196
  },
225
197
  placeholder: {
226
198
  type: String,
@@ -236,31 +208,31 @@ const __vue2_script = {
236
208
  },
237
209
  onlyExistingTags: {
238
210
  type: Boolean,
239
- default: false
211
+ default: !1
240
212
  },
241
213
  deleteOnBackspace: {
242
214
  type: Boolean,
243
- default: true
215
+ default: !0
244
216
  },
245
217
  allowDuplicates: {
246
218
  type: Boolean,
247
- default: false
219
+ default: !1
248
220
  },
249
221
  validate: {
250
222
  type: Function,
251
- default: () => true
223
+ default: () => !0
252
224
  },
253
225
  addTagsOnComma: {
254
226
  type: Boolean,
255
- default: false
227
+ default: !1
256
228
  },
257
229
  addTagsOnSpace: {
258
230
  type: Boolean,
259
- default: false
231
+ default: !1
260
232
  },
261
233
  addTagsOnBlur: {
262
234
  type: Boolean,
263
- default: false
235
+ default: !1
264
236
  },
265
237
  wrapperClass: {
266
238
  type: String,
@@ -268,19 +240,19 @@ const __vue2_script = {
268
240
  },
269
241
  sortSearchResults: {
270
242
  type: Boolean,
271
- default: true
243
+ default: !0
272
244
  },
273
245
  caseSensitiveTags: {
274
246
  type: Boolean,
275
- default: false
247
+ default: !1
276
248
  },
277
249
  beforeAddingTag: {
278
250
  type: Function,
279
- default: () => true
251
+ default: () => !0
280
252
  },
281
253
  beforeRemovingTag: {
282
254
  type: Function,
283
- default: () => true
255
+ default: () => !0
284
256
  }
285
257
  },
286
258
  data() {
@@ -294,180 +266,107 @@ const __vue2_script = {
294
266
  };
295
267
  },
296
268
  watch: {
297
- input(newVal, oldVal) {
298
- this.$emit("input-changed", newVal);
299
- this.searchTag(false);
300
- if (newVal.length && newVal !== oldVal) {
301
- if (this.addTagsOnSpace) {
302
- if (newVal.endsWith(" ")) {
303
- this.input = newVal.trim();
304
- this.tagFromInput(true);
305
- }
306
- }
307
- if (this.addTagsOnComma) {
308
- newVal = newVal.trim();
309
- if (newVal.endsWith(",")) {
310
- this.input = newVal.substring(0, newVal.length - 1);
311
- this.tagFromInput(true);
312
- }
313
- }
314
- this.$emit("change", newVal);
315
- }
269
+ input(e, s) {
270
+ this.$emit("input-changed", e), this.searchTag(!1), e.length && e !== s && (this.addTagsOnSpace && e.endsWith(" ") && (this.input = e.trim(), this.tagFromInput(!0)), this.addTagsOnComma && (e = e.trim(), e.endsWith(",") && (this.input = e.substring(0, e.length - 1), this.tagFromInput(!0))), this.$emit("change", e));
316
271
  },
317
272
  tags() {
318
- this.hiddenInput = JSON.stringify(this.tags);
319
- this.$emit("input", this.tags);
273
+ this.hiddenInput = JSON.stringify(this.tags), this.$emit("input", this.tags);
320
274
  },
321
275
  value() {
322
276
  this.tagsFromValue();
323
277
  },
324
- typeaheadAlwaysShow(newValue) {
325
- if (newValue) {
326
- this.searchTag(false);
327
- } else {
328
- this.clearSearchResults();
329
- }
278
+ typeaheadAlwaysShow(e) {
279
+ e ? this.searchTag(!1) : this.clearSearchResults();
330
280
  }
331
281
  },
332
282
  created() {
333
- this.tagsFromValue();
334
- if (this.typeaheadAlwaysShow) {
335
- this.searchTag(false);
336
- }
337
- this.$emit("initialized");
283
+ this.tagsFromValue(), this.typeaheadAlwaysShow && this.searchTag(!1), this.$emit("initialized");
338
284
  },
339
285
  methods: {
340
- escapeRegExp(string) {
341
- return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
342
- },
343
- tagFromInput(ignoreSearchResults = false) {
344
- if (this.searchResults.length && this.searchSelection >= 0 && !ignoreSearchResults) {
345
- this.tagFromSearch(this.searchResults[this.searchSelection]);
346
- this.input = "";
347
- } else {
348
- const text = this.input.trim();
349
- if (!this.onlyExistingTags && text.length && this.validate(text)) {
286
+ escapeRegExp(e) {
287
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
288
+ },
289
+ tagFromInput(e = !1) {
290
+ if (this.searchResults.length && this.searchSelection >= 0 && !e)
291
+ this.tagFromSearch(this.searchResults[this.searchSelection]), this.input = "";
292
+ else {
293
+ const s = this.input.trim();
294
+ if (!this.onlyExistingTags && s.length && this.validate(s)) {
350
295
  this.input = "";
351
- let newTag = {
296
+ let a = {
352
297
  key: "",
353
- value: text
298
+ value: s
354
299
  };
355
- const searchQuery = this.escapeRegExp(this.caseSensitiveTags ? newTag.value : newTag.value.toLowerCase());
356
- for (const tag of this.existingTags) {
357
- const compareable = this.caseSensitiveTags ? tag.value : tag.value.toLowerCase();
358
- if (searchQuery === compareable) {
359
- newTag = Object.assign({}, tag);
300
+ const t = this.escapeRegExp(this.caseSensitiveTags ? a.value : a.value.toLowerCase());
301
+ for (const i of this.existingTags) {
302
+ const n = this.caseSensitiveTags ? i.value : i.value.toLowerCase();
303
+ if (t === n) {
304
+ a = Object.assign({}, i);
360
305
  break;
361
306
  }
362
307
  }
363
- this.addTag(newTag);
308
+ this.addTag(a);
364
309
  }
365
310
  }
366
311
  },
367
- tagFromSearchOnClick(tag) {
368
- this.tagFromSearch(tag);
369
- this.$refs.taginput.blur();
312
+ tagFromSearchOnClick(e) {
313
+ this.tagFromSearch(e), this.$refs.taginput.blur();
370
314
  },
371
- tagFromSearch(tag) {
372
- this.clearSearchResults();
373
- this.addTag(tag);
374
- this.$nextTick(() => {
375
- this.input = "";
376
- this.oldInput = "";
315
+ tagFromSearch(e) {
316
+ this.clearSearchResults(), this.addTag(e), this.$nextTick(() => {
317
+ this.input = "", this.oldInput = "";
377
318
  });
378
319
  },
379
- addTag(tag) {
380
- if (!this.beforeAddingTag(tag)) {
381
- return false;
382
- }
383
- if (this.limit > 0 && this.tags.length >= this.limit) {
384
- this.$emit("limit-reached");
385
- return false;
386
- }
387
- if (!this.tagSelected(tag)) {
388
- this.tags.push(tag);
389
- this.$nextTick(() => {
390
- this.$emit("tag-added", tag);
391
- this.$emit("tags-updated");
392
- });
393
- }
320
+ addTag(e) {
321
+ if (!this.beforeAddingTag(e))
322
+ return !1;
323
+ if (this.limit > 0 && this.tags.length >= this.limit)
324
+ return this.$emit("limit-reached"), !1;
325
+ this.tagSelected(e) || (this.tags.push(e), this.$nextTick(() => {
326
+ this.$emit("tag-added", e), this.$emit("tags-updated");
327
+ }));
394
328
  },
395
329
  removeLastTag() {
396
- if (!this.input.length && this.deleteOnBackspace && this.tags.length) {
397
- this.removeTag(this.tags.length - 1);
398
- }
399
- },
400
- removeTag(index) {
401
- const tag = this.tags[index];
402
- if (!this.beforeRemovingTag(tag)) {
403
- return false;
404
- }
405
- this.tags.splice(index, 1);
406
- this.$nextTick(() => {
407
- this.$emit("tag-removed", tag);
408
- this.$emit("tags-updated");
409
- if (this.typeaheadAlwaysShow) {
410
- this.searchTag();
411
- }
330
+ !this.input.length && this.deleteOnBackspace && this.tags.length && this.removeTag(this.tags.length - 1);
331
+ },
332
+ removeTag(e) {
333
+ const s = this.tags[e];
334
+ if (!this.beforeRemovingTag(s))
335
+ return !1;
336
+ this.tags.splice(e, 1), this.$nextTick(() => {
337
+ this.$emit("tag-removed", s), this.$emit("tags-updated"), this.typeaheadAlwaysShow && this.searchTag();
412
338
  });
413
339
  },
414
340
  searchTag() {
415
- if (this.typeahead !== true) {
416
- return false;
417
- }
341
+ if (this.typeahead !== !0)
342
+ return !1;
418
343
  if (this.oldInput !== this.input || !this.searchResults.length && this.typeaheadActivationThreshold === 0 || this.typeaheadAlwaysShow) {
419
- this.searchResults = [];
420
- this.searchSelection = 0;
421
- const input = this.input.trim();
422
- if (input.length && input.length >= this.typeaheadActivationThreshold || this.typeaheadActivationThreshold === 0 || this.typeaheadAlwaysShow) {
423
- const searchQuery = this.escapeRegExp(this.caseSensitiveTags ? input : input.toLowerCase());
424
- for (const tag of this.existingTags) {
425
- const compareable = this.caseSensitiveTags ? tag.value : tag.value.toLowerCase();
426
- if (compareable.search(searchQuery) > -1 && !this.tagSelected(tag)) {
427
- this.searchResults.push(tag);
428
- }
429
- }
430
- if (this.sortSearchResults) {
431
- this.searchResults.sort((a, b) => {
432
- if (a.value < b.value)
433
- return -1;
434
- if (a.value > b.value)
435
- return 1;
436
- return 0;
437
- });
438
- }
439
- if (this.typeaheadMaxResults > 0) {
440
- this.searchResults = this.searchResults.slice(0, this.typeaheadMaxResults);
441
- }
344
+ this.searchResults = [], this.searchSelection = 0;
345
+ const e = this.input.trim();
346
+ if (e.length && e.length >= this.typeaheadActivationThreshold || this.typeaheadActivationThreshold === 0 || this.typeaheadAlwaysShow) {
347
+ const s = this.escapeRegExp(this.caseSensitiveTags ? e : e.toLowerCase());
348
+ for (const a of this.existingTags)
349
+ (this.caseSensitiveTags ? a.value : a.value.toLowerCase()).search(s) > -1 && !this.tagSelected(a) && this.searchResults.push(a);
350
+ this.sortSearchResults && this.searchResults.sort((a, t) => a.value < t.value ? -1 : a.value > t.value ? 1 : 0), this.typeaheadMaxResults > 0 && (this.searchResults = this.searchResults.slice(0, this.typeaheadMaxResults));
442
351
  }
443
352
  this.oldInput = this.input;
444
353
  }
445
354
  },
446
355
  hideTypeahead() {
447
- if (!this.input.length) {
448
- this.$nextTick(() => {
449
- this.clearSearchResults();
450
- });
451
- }
356
+ this.input.length || this.$nextTick(() => {
357
+ this.clearSearchResults();
358
+ });
452
359
  },
453
360
  nextSearchResult() {
454
- if (this.searchSelection + 1 <= this.searchResults.length - 1) {
455
- this.searchSelection++;
456
- }
361
+ this.searchSelection + 1 <= this.searchResults.length - 1 && this.searchSelection++;
457
362
  },
458
363
  prevSearchResult() {
459
- if (this.searchSelection > 0) {
460
- this.searchSelection--;
461
- }
364
+ this.searchSelection > 0 && this.searchSelection--;
462
365
  },
463
366
  clearSearchResults() {
464
- this.searchResults = [];
465
- this.searchSelection = 0;
466
- if (this.typeaheadAlwaysShow) {
467
- this.$nextTick(() => {
468
- this.searchTag();
469
- });
470
- }
367
+ this.searchResults = [], this.searchSelection = 0, this.typeaheadAlwaysShow && this.$nextTick(() => {
368
+ this.searchTag();
369
+ });
471
370
  },
472
371
  clearTags() {
473
372
  this.tags.splice(0, this.tags.length);
@@ -478,36 +377,28 @@ const __vue2_script = {
478
377
  console.error("Voerro Tags Input: the v-model value must be an array!");
479
378
  return;
480
379
  }
481
- const tags = this.value;
482
- if (this.tags === tags) {
380
+ const e = this.value;
381
+ if (this.tags === e)
483
382
  return;
484
- }
485
383
  this.clearTags();
486
- for (const tag of tags) {
487
- this.addTag(tag);
488
- }
384
+ for (const s of e)
385
+ this.addTag(s);
489
386
  } else {
490
- if (this.tags.length === 0) {
387
+ if (this.tags.length === 0)
491
388
  return;
492
- }
493
389
  this.clearTags();
494
390
  }
495
391
  },
496
- tagSelected(tag) {
497
- if (this.allowDuplicates) {
498
- return false;
499
- }
500
- if (!tag) {
501
- return false;
502
- }
503
- const searchQuery = this.escapeRegExp(this.caseSensitiveTags ? tag.value : tag.value.toLowerCase());
504
- for (const selectedTag of this.tags) {
505
- const compareable = this.caseSensitiveTags ? selectedTag.value : selectedTag.value.toLowerCase();
506
- if (selectedTag.key === tag.key && compareable.search(searchQuery) > -1) {
507
- return true;
508
- }
392
+ tagSelected(e) {
393
+ if (this.allowDuplicates || !e)
394
+ return !1;
395
+ const s = this.escapeRegExp(this.caseSensitiveTags ? e.value : e.value.toLowerCase());
396
+ for (const a of this.tags) {
397
+ const t = this.caseSensitiveTags ? a.value : a.value.toLowerCase();
398
+ if (a.key === e.key && t.search(s) > -1)
399
+ return !0;
509
400
  }
510
- return false;
401
+ return !1;
511
402
  },
512
403
  clearInput() {
513
404
  this.input = "";
@@ -519,41 +410,30 @@ const __vue2_script = {
519
410
  this.$emit("keydown", e);
520
411
  },
521
412
  onFocus(e) {
522
- this.$emit("focus", e);
523
- this.searchTag();
413
+ this.$emit("focus", e), this.searchTag();
524
414
  },
525
415
  onBlur(e) {
526
- this.$emit("blur", e);
527
- if (this.addTagsOnBlur) {
528
- this.tagFromInput(true);
529
- }
530
- if (!this.typeaheadAlwaysShow) {
531
- this.hideTypeahead();
532
- } else {
533
- this.searchTag();
534
- }
416
+ this.$emit("blur", e), this.addTagsOnBlur && this.tagFromInput(!0), this.typeaheadAlwaysShow ? this.searchTag() : this.hideTypeahead();
535
417
  }
536
418
  }
537
- };
538
- const __cssModules = {};
539
- var __component__ = /* @__PURE__ */ normalizeComponent(
540
- __vue2_script,
541
- render,
542
- staticRenderFns,
543
- false,
544
- __vue2_injectStyles,
419
+ }, r = {};
420
+ var c = /* @__PURE__ */ l(
421
+ o,
422
+ h,
423
+ u,
424
+ !1,
425
+ p,
545
426
  null,
546
427
  null,
547
428
  null
548
429
  );
549
- function __vue2_injectStyles(context) {
550
- for (let o in __cssModules) {
551
- this[o] = __cssModules[o];
552
- }
430
+ function p(e) {
431
+ for (let s in r)
432
+ this[s] = r[s];
553
433
  }
554
- const VueTagsInput = /* @__PURE__ */ function() {
555
- return __component__.exports;
434
+ const g = /* @__PURE__ */ function() {
435
+ return c.exports;
556
436
  }();
557
437
  export {
558
- VueTagsInput as default
438
+ g as default
559
439
  };