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