@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.
- package/dist/chunks/3a79781b.js +75 -0
- package/dist/chunks/{44b78389.js → 41a066be.js} +8 -8
- package/dist/chunks/{e1939731.js → 5a78e0db.js} +5 -6
- package/dist/chunks/5d4282fb.js +30 -0
- package/dist/chunks/{822300f3.js → 61ad06b2.js} +3 -3
- package/dist/chunks/76680a03.js +24 -0
- package/dist/chunks/8c0142e0.js +81 -0
- package/dist/chunks/97652d86.js +26 -0
- package/dist/chunks/b4acd3a6.js +126 -0
- package/dist/chunks/f71045fc.js +184 -0
- package/dist/components/address-input/index.js +43 -56
- package/dist/components/address-input/style.css +1 -15
- package/dist/components/aside-menu/index.js +30 -36
- package/dist/components/aside-menu/style.css +1 -9
- package/dist/components/awesome-button/index.js +32 -35
- package/dist/components/base.css +1 -66
- package/dist/components/capsule-tab/index.js +27 -33
- package/dist/components/capsule-tab/style.css +1 -32
- package/dist/components/chunk-file-uploader/index.js +54 -88
- package/dist/components/chunk-file-uploader/style.css +1 -4
- package/dist/components/chunk-file-uploader-button/index.js +25 -31
- package/dist/components/chunk-file-uploader-button/style.css +1 -17
- package/dist/components/chunk-file-uploader-drop/index.js +28 -42
- package/dist/components/chunk-file-uploader-drop/style.css +1 -12
- package/dist/components/chunk-file-uploader-file/index.js +134 -211
- package/dist/components/chunk-file-uploader-file/style.css +1 -125
- package/dist/components/chunk-file-uploader-files/index.js +28 -34
- package/dist/components/chunk-file-uploader-files/style.css +1 -9
- package/dist/components/chunk-file-uploader-list/index.js +29 -35
- package/dist/components/chunk-file-uploader-list/style.css +1 -9
- package/dist/components/chunk-file-uploader-un-support/index.js +30 -38
- package/dist/components/chunk-file-uploader-un-support/style.css +1 -6
- package/dist/components/code-mirror-editor/index.js +153 -181
- package/dist/components/code-mirror-editor/style.css +1 -17
- package/dist/components/color-picker/index.js +49 -68
- package/dist/components/confirm-button/index.js +19 -21
- package/dist/components/confirmable/index.js +18 -19
- package/dist/components/context-menu/index.js +108 -130
- package/dist/components/context-menu/style.css +1 -88
- package/dist/components/custom-scrollbar/index.js +49 -67
- package/dist/components/data-table-picker/index.js +62 -81
- package/dist/components/dynamic-table/index.js +89 -113
- package/dist/components/dynamic-table/style.css +1 -30
- package/dist/components/e-charts/index.js +120 -201
- package/dist/components/e-charts/style.css +1 -10
- package/dist/components/editable-progress/index.js +60 -93
- package/dist/components/editable-progress/style.css +1 -37
- package/dist/components/editable-tree/index.js +423 -638
- package/dist/components/editable-tree/style.css +1 -82
- package/dist/components/egd-collapse/index.js +33 -46
- package/dist/components/egd-collapse-item/index.js +60 -76
- package/dist/components/element-dialog/index.js +95 -147
- package/dist/components/element-dialog/style.css +1 -102
- package/dist/components/empty-view/index.js +28 -34
- package/dist/components/empty-view/style.css +1 -17
- package/dist/components/error-view/index.js +26 -32
- package/dist/components/error-view/style.css +1 -17
- package/dist/components/flex-column/index.js +25 -40
- package/dist/components/flex-item/index.js +29 -57
- package/dist/components/flex-row/index.js +25 -40
- package/dist/components/flex-scroller/index.js +26 -32
- package/dist/components/flex-scroller/style.css +1 -20
- package/dist/components/form-button/index.js +34 -38
- package/dist/components/form-cascader/index.js +71 -81
- package/dist/components/form-checkbox-group/index.js +88 -113
- package/dist/components/form-checkbox-group/style.css +1 -51
- package/dist/components/form-date-picker/index.js +70 -132
- package/dist/components/form-holder/index.js +32 -39
- package/dist/components/form-input/index.js +56 -62
- package/dist/components/form-input-email/index.js +48 -60
- package/dist/components/form-input-id-card/index.js +53 -59
- package/dist/components/form-input-number/index.js +61 -68
- package/dist/components/form-input-number/style.css +1 -12
- package/dist/components/form-input-phone-number/index.js +49 -55
- package/dist/components/form-input-time/index.js +53 -59
- package/dist/components/form-item/index.js +80 -123
- package/dist/components/form-item/style.css +1 -11
- package/dist/components/form-item-config-provider/index.js +25 -26
- package/dist/components/form-item-group/index.js +85 -111
- package/dist/components/form-item-group/style.css +1 -30
- package/dist/components/form-radio-group/index.js +85 -104
- package/dist/components/form-radio-group/style.css +1 -53
- package/dist/components/form-select/index.js +76 -91
- package/dist/components/form-switch/index.js +51 -57
- package/dist/components/form-textarea/index.js +51 -57
- package/dist/components/form-view/index.js +165 -232
- package/dist/components/form-view/style.css +1 -158
- package/dist/components/guide-steps/index.js +44 -58
- package/dist/components/guide-steps/style.css +1 -34
- package/dist/components/icon-card/index.js +29 -35
- package/dist/components/icon-card/style.css +1 -56
- package/dist/components/iframe-window/index.js +29 -35
- package/dist/components/iframe-window/style.css +1 -20
- package/dist/components/image-viewer/index.js +48 -66
- package/dist/components/image-viewer/style.css +1 -21
- package/dist/components/input-number/index.js +127 -193
- package/dist/components/input-number/style.css +1 -15
- package/dist/components/input-number-range/index.js +45 -57
- package/dist/components/input-number-range/style.css +1 -12
- package/dist/components/j-s-x-component/index.js +4 -4
- package/dist/components/keep-view-alive/index.js +73 -120
- package/dist/components/loading-view/index.js +26 -32
- package/dist/components/loading-view/style.css +1 -17
- package/dist/components/nav-bar/index.js +27 -37
- package/dist/components/nav-bar/style.css +1 -17
- package/dist/components/not-implement/index.js +23 -31
- package/dist/components/not-implement/style.css +1 -15
- package/dist/components/page/index.js +22 -28
- package/dist/components/page/style.css +1 -12
- package/dist/components/page-header/index.js +30 -36
- package/dist/components/page-header/style.css +1 -14
- package/dist/components/page-index/index.js +62 -83
- package/dist/components/page-index/style.css +1 -23
- package/dist/components/page-index-top/index.js +53 -68
- package/dist/components/page-skeleton/index.js +31 -37
- package/dist/components/page-skeleton/style.css +1 -23
- package/dist/components/page-skeleton-new/index.js +42 -48
- package/dist/components/page-skeleton-new/style.css +1 -42
- package/dist/components/pageable-table/index.js +186 -253
- package/dist/components/pageable-table/style.css +1 -72
- package/dist/components/pageable-view/index.js +129 -199
- package/dist/components/pageable-view/style.css +1 -69
- package/dist/components/photo-swipe/index.js +110 -151
- package/dist/components/photo-swipe/style.css +1 -20
- package/dist/components/resize-observer/index.js +34 -68
- package/dist/components/resize-observer/style.css +1 -31
- package/dist/components/search-popover/index.js +153 -211
- package/dist/components/search-popover/style.css +1 -93
- package/dist/components/sign-panel/index.js +92 -142
- package/dist/components/sign-panel/style.css +1 -97
- package/dist/components/split-pane/index.js +101 -162
- package/dist/components/split-pane/style.css +1 -100
- package/dist/components/stateful/index.js +31 -34
- package/dist/components/stateful/style.css +1 -33
- package/dist/components/static-pageable-table/index.js +37 -44
- package/dist/components/static-pageable-table/style.css +1 -9
- package/dist/components/swiper/index.js +85 -150
- package/dist/components/swiper/style.css +1 -43
- package/dist/components/tab/index.js +54 -72
- package/dist/components/tab/style.css +1 -122
- package/dist/components/tab-item/index.js +30 -35
- package/dist/components/table-column/index.js +30 -32
- package/dist/components/table-view/index.js +156 -227
- package/dist/components/table-view/style.css +1 -95
- package/dist/components/tag-render/index.js +44 -58
- package/dist/components/tag-render/style.css +1 -33
- package/dist/components/tinymce-editor/index.js +79 -95
- package/dist/components/tinymce-editor/style.css +1 -43
- package/dist/components/tinymce-wrapper/index.js +92 -121
- package/dist/components/tinymce-wrapper/style.css +1 -36
- package/dist/components/toolbar/index.js +63 -84
- package/dist/components/toolbar/style.css +1 -39
- package/dist/components/toolbar-button/index.js +41 -48
- package/dist/components/toolbar-button/style.css +1 -21
- package/dist/components/trigger/index.js +29 -36
- package/dist/components/vue-tags-input/index.js +188 -308
- package/dist/components/vue-tags-input/style.css +1 -682
- package/dist/components/watermark/index.js +25 -37
- package/dist/components/watermark/style.css +1 -11
- package/dist/components/x-dialog/index.js +67 -93
- package/dist/components/x-dialog/style.css +1 -15
- package/dist/index.css +193 -1105
- package/dist/index.es.js +4790 -7243
- package/package.json +1 -1
- package/web-types.json +1 -1
- package/dist/chunks/3d28cc08.js +0 -57
- package/dist/chunks/5d33812d.js +0 -147
- package/dist/chunks/9d848bf6.js +0 -99
- package/dist/chunks/a0bb327b.js +0 -96
- package/dist/chunks/a8891d2c.js +0 -30
- package/dist/chunks/c69d5628.js +0 -248
- package/dist/chunks/de9fe802.js +0 -24
|
@@ -1,186 +1,162 @@
|
|
|
1
|
-
import { n as
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
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
|
-
}, [
|
|
9
|
-
class: `${
|
|
10
|
-
}, [
|
|
11
|
-
return
|
|
12
|
-
key:
|
|
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
|
-
}, [
|
|
12
|
+
}, [a("span", {
|
|
15
13
|
domProps: {
|
|
16
|
-
|
|
14
|
+
innerHTML: e._s(t.value)
|
|
17
15
|
}
|
|
18
|
-
}),
|
|
16
|
+
}), a("i", {
|
|
19
17
|
staticClass: "tags-input-remove ov",
|
|
20
18
|
attrs: {
|
|
21
|
-
|
|
19
|
+
href: "#"
|
|
22
20
|
},
|
|
23
21
|
on: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return _vm.removeTag(index);
|
|
22
|
+
click: function(n) {
|
|
23
|
+
return n.preventDefault(), e.removeTag(i);
|
|
27
24
|
}
|
|
28
25
|
}
|
|
29
26
|
})]);
|
|
30
|
-
}),
|
|
27
|
+
}), a("input", {
|
|
31
28
|
directives: [{
|
|
32
29
|
name: "model",
|
|
33
30
|
rawName: "v-model",
|
|
34
|
-
value:
|
|
31
|
+
value: e.input,
|
|
35
32
|
expression: "input"
|
|
36
33
|
}],
|
|
37
34
|
ref: "taginput",
|
|
38
35
|
staticStyle: {
|
|
39
|
-
|
|
36
|
+
height: "28px",
|
|
40
37
|
"margin-top": "5px",
|
|
41
38
|
"line-height": "28px"
|
|
42
39
|
},
|
|
43
40
|
attrs: {
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
type: "text",
|
|
42
|
+
placeholder: e.placeholder
|
|
46
43
|
},
|
|
47
44
|
domProps: {
|
|
48
|
-
|
|
45
|
+
value: e.input
|
|
49
46
|
},
|
|
50
47
|
on: {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
}),
|
|
67
|
+
}), e.elementId ? a("input", {
|
|
84
68
|
directives: [{
|
|
85
69
|
name: "model",
|
|
86
70
|
rawName: "v-model",
|
|
87
|
-
value:
|
|
71
|
+
value: e.hiddenInput,
|
|
88
72
|
expression: "hiddenInput"
|
|
89
73
|
}],
|
|
90
74
|
attrs: {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
75
|
+
id: e.elementId,
|
|
76
|
+
type: "hidden",
|
|
77
|
+
name: e.elementId
|
|
94
78
|
},
|
|
95
79
|
domProps: {
|
|
96
|
-
|
|
80
|
+
value: e.hiddenInput
|
|
97
81
|
},
|
|
98
82
|
on: {
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
}) :
|
|
87
|
+
}) : e._e()], 2), a("div", {
|
|
106
88
|
directives: [{
|
|
107
89
|
name: "show",
|
|
108
90
|
rawName: "v-show",
|
|
109
|
-
value:
|
|
91
|
+
value: e.searchResults.length,
|
|
110
92
|
expression: "searchResults.length"
|
|
111
93
|
}]
|
|
112
|
-
}, [
|
|
113
|
-
class: `typeahead-${
|
|
114
|
-
}, [
|
|
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
|
-
|
|
99
|
+
textContent: e._s(e.discardSearchText)
|
|
118
100
|
},
|
|
119
101
|
on: {
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
})
|
|
126
|
-
return
|
|
127
|
-
key:
|
|
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":
|
|
131
|
-
"tags-input-typeahead-item-highlighted-default":
|
|
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
|
-
|
|
115
|
+
innerHTML: e._s(t.value)
|
|
135
116
|
},
|
|
136
117
|
on: {
|
|
137
|
-
|
|
138
|
-
|
|
118
|
+
mouseover: function(n) {
|
|
119
|
+
e.searchSelection = i;
|
|
139
120
|
},
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return _vm.tagFromSearchOnClick(tag);
|
|
121
|
+
mousedown: function(n) {
|
|
122
|
+
return n.preventDefault(), e.tagFromSearchOnClick(t);
|
|
143
123
|
}
|
|
144
124
|
}
|
|
145
125
|
});
|
|
146
|
-
})], 2) :
|
|
147
|
-
class: `typeahead-${
|
|
148
|
-
}, [
|
|
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
|
-
|
|
131
|
+
textContent: e._s(e.discardSearchText)
|
|
152
132
|
},
|
|
153
133
|
on: {
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
})
|
|
160
|
-
return
|
|
161
|
-
key:
|
|
138
|
+
}), e._l(e.searchResults, function(t, i) {
|
|
139
|
+
return a("li", {
|
|
140
|
+
key: i,
|
|
162
141
|
class: {
|
|
163
|
-
"tags-input-typeahead-item-default":
|
|
164
|
-
"tags-input-typeahead-item-highlighted-default":
|
|
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
|
-
|
|
146
|
+
innerHTML: e._s(t.value)
|
|
168
147
|
},
|
|
169
148
|
on: {
|
|
170
|
-
|
|
171
|
-
|
|
149
|
+
mouseover: function(n) {
|
|
150
|
+
e.searchSelection = i;
|
|
172
151
|
},
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
return _vm.tagFromSearchOnClick(tag);
|
|
152
|
+
mousedown: function(n) {
|
|
153
|
+
return n.preventDefault(), e.tagFromSearchOnClick(t);
|
|
176
154
|
}
|
|
177
155
|
}
|
|
178
156
|
});
|
|
179
|
-
})], 2) :
|
|
180
|
-
};
|
|
181
|
-
|
|
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:
|
|
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:
|
|
191
|
+
default: !1
|
|
220
192
|
},
|
|
221
193
|
typeaheadHideDiscard: {
|
|
222
194
|
type: Boolean,
|
|
223
|
-
default:
|
|
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:
|
|
211
|
+
default: !1
|
|
240
212
|
},
|
|
241
213
|
deleteOnBackspace: {
|
|
242
214
|
type: Boolean,
|
|
243
|
-
default:
|
|
215
|
+
default: !0
|
|
244
216
|
},
|
|
245
217
|
allowDuplicates: {
|
|
246
218
|
type: Boolean,
|
|
247
|
-
default:
|
|
219
|
+
default: !1
|
|
248
220
|
},
|
|
249
221
|
validate: {
|
|
250
222
|
type: Function,
|
|
251
|
-
default: () =>
|
|
223
|
+
default: () => !0
|
|
252
224
|
},
|
|
253
225
|
addTagsOnComma: {
|
|
254
226
|
type: Boolean,
|
|
255
|
-
default:
|
|
227
|
+
default: !1
|
|
256
228
|
},
|
|
257
229
|
addTagsOnSpace: {
|
|
258
230
|
type: Boolean,
|
|
259
|
-
default:
|
|
231
|
+
default: !1
|
|
260
232
|
},
|
|
261
233
|
addTagsOnBlur: {
|
|
262
234
|
type: Boolean,
|
|
263
|
-
default:
|
|
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:
|
|
243
|
+
default: !0
|
|
272
244
|
},
|
|
273
245
|
caseSensitiveTags: {
|
|
274
246
|
type: Boolean,
|
|
275
|
-
default:
|
|
247
|
+
default: !1
|
|
276
248
|
},
|
|
277
249
|
beforeAddingTag: {
|
|
278
250
|
type: Function,
|
|
279
|
-
default: () =>
|
|
251
|
+
default: () => !0
|
|
280
252
|
},
|
|
281
253
|
beforeRemovingTag: {
|
|
282
254
|
type: Function,
|
|
283
|
-
default: () =>
|
|
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(
|
|
298
|
-
this.$emit("input-changed",
|
|
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(
|
|
325
|
-
|
|
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(
|
|
341
|
-
return
|
|
342
|
-
},
|
|
343
|
-
tagFromInput(
|
|
344
|
-
if (this.searchResults.length && this.searchSelection >= 0 && !
|
|
345
|
-
this.tagFromSearch(this.searchResults[this.searchSelection]);
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
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
|
|
296
|
+
let a = {
|
|
352
297
|
key: "",
|
|
353
|
-
value:
|
|
298
|
+
value: s
|
|
354
299
|
};
|
|
355
|
-
const
|
|
356
|
-
for (const
|
|
357
|
-
const
|
|
358
|
-
if (
|
|
359
|
-
|
|
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(
|
|
308
|
+
this.addTag(a);
|
|
364
309
|
}
|
|
365
310
|
}
|
|
366
311
|
},
|
|
367
|
-
tagFromSearchOnClick(
|
|
368
|
-
this.tagFromSearch(
|
|
369
|
-
this.$refs.taginput.blur();
|
|
312
|
+
tagFromSearchOnClick(e) {
|
|
313
|
+
this.tagFromSearch(e), this.$refs.taginput.blur();
|
|
370
314
|
},
|
|
371
|
-
tagFromSearch(
|
|
372
|
-
this.clearSearchResults()
|
|
373
|
-
|
|
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(
|
|
380
|
-
if (!this.beforeAddingTag(
|
|
381
|
-
return
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
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
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
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 !==
|
|
416
|
-
return
|
|
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
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
|
|
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
|
-
|
|
448
|
-
this
|
|
449
|
-
|
|
450
|
-
});
|
|
451
|
-
}
|
|
356
|
+
this.input.length || this.$nextTick(() => {
|
|
357
|
+
this.clearSearchResults();
|
|
358
|
+
});
|
|
452
359
|
},
|
|
453
360
|
nextSearchResult() {
|
|
454
|
-
|
|
455
|
-
this.searchSelection++;
|
|
456
|
-
}
|
|
361
|
+
this.searchSelection + 1 <= this.searchResults.length - 1 && this.searchSelection++;
|
|
457
362
|
},
|
|
458
363
|
prevSearchResult() {
|
|
459
|
-
|
|
460
|
-
this.searchSelection--;
|
|
461
|
-
}
|
|
364
|
+
this.searchSelection > 0 && this.searchSelection--;
|
|
462
365
|
},
|
|
463
366
|
clearSearchResults() {
|
|
464
|
-
this.searchResults = []
|
|
465
|
-
|
|
466
|
-
|
|
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
|
|
482
|
-
if (this.tags ===
|
|
380
|
+
const e = this.value;
|
|
381
|
+
if (this.tags === e)
|
|
483
382
|
return;
|
|
484
|
-
}
|
|
485
383
|
this.clearTags();
|
|
486
|
-
for (const
|
|
487
|
-
this.addTag(
|
|
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(
|
|
497
|
-
if (this.allowDuplicates)
|
|
498
|
-
return
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
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
|
|
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
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
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
|
|
550
|
-
for (let
|
|
551
|
-
this[
|
|
552
|
-
}
|
|
430
|
+
function p(e) {
|
|
431
|
+
for (let s in r)
|
|
432
|
+
this[s] = r[s];
|
|
553
433
|
}
|
|
554
|
-
const
|
|
555
|
-
return
|
|
434
|
+
const g = /* @__PURE__ */ function() {
|
|
435
|
+
return c.exports;
|
|
556
436
|
}();
|
|
557
437
|
export {
|
|
558
|
-
|
|
438
|
+
g as default
|
|
559
439
|
};
|